Skip to content

Commit ffc7b6c

Browse files
authored
Avoid infinite loop if command "fpm-" is in path (#713)
If a copy of fpm is renamed fpm- it will be called recursively because plugin-names are searched for in the form of "fpm-*" because since there is no test if the plugin suffix is blank the "fpm-" command will be called. A relatively minor bug; but it takes a one-line change to fix and is quite confusing to anyone with a "fpm-" command in their path.
1 parent 87dcb9b commit ffc7b6c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/fpm_command_line.f90

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,8 @@ subroutine get_command_line_settings(cmd_settings)
574574

575575
case default
576576

577-
if(which('fpm-'//cmdarg).ne.'')then
577+
if(cmdarg.ne.''.and.which('fpm-'//cmdarg).ne.'')then
578+
578579
call run('fpm-'//trim(cmdarg)//' '// get_command_arguments_quoted(),.false.)
579580
else
580581
call set_args('&

0 commit comments

Comments
 (0)