From 657f25cbb880c67cd18a4b20f3d5a303ce3c9986 Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Tue, 19 Jan 2021 13:41:37 -0500 Subject: [PATCH] Interpret an empty string in PATH as "." in findProgram Closes: #1841 --- M2/Macaulay2/m2/programs.m2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/M2/Macaulay2/m2/programs.m2 b/M2/Macaulay2/m2/programs.m2 index cbef6e20c30..fe076622154 100644 --- a/M2/Macaulay2/m2/programs.m2 +++ b/M2/Macaulay2/m2/programs.m2 @@ -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;