Skip to content

Commit

Permalink
Interpret an empty string in PATH as "." in findProgram
Browse files Browse the repository at this point in the history
Closes: #1841
  • Loading branch information
d-torrance committed Jan 19, 2021
1 parent 7d4e4e3 commit 657f25c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion M2/Macaulay2/m2/programs.m2
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@ getProgramPath = (name, cmds, opts) -> (
pathsToTry = pathsToTry | opts.AdditionalPaths;
-- finally, try PATH
if getenv "PATH" != "" then
pathsToTry = join(pathsToTry, separate(":", getenv "PATH"));
pathsToTry = join(pathsToTry,
apply(separate(":", getenv "PATH"), dir ->
if dir == "" then "." else dir));
pathsToTry = apply(pathsToTry, addSlash);
prefixes := {(".*", "")} | opts.Prefix;
errorCode := 1;
Expand Down

0 comments on commit 657f25c

Please sign in to comment.