summaryrefslogtreecommitdiff
path: root/tests/scripts/misc
diff options
context:
space:
mode:
authorPaul Smith <psmith@gnu.org>2020-04-01 01:13:02 -0400
committerPaul Smith <psmith@gnu.org>2020-04-01 02:02:57 -0400
commit0c326a66c9eb3a3b5e4ab7892578b016b0590b1f (patch)
tree9b31aa163417015ebfb05b870eedaf2ff2ed8b5e /tests/scripts/misc
parentf79bde1a6d6899641370835fb2aafcd8ec224301 (diff)
downloadmake-git-0c326a66c9eb3a3b5e4ab7892578b016b0590b1f.tar.gz
[SV 57674] Use the system default PATH if $PATH is not set
When using execvp() if $PATH is not present in the environment it will automatically search the system default PATH string. Emulate this by passing the system default PATH to find_in_given_path() if we don't find PATH in the environment. * src/job.c (child_execute_job): Use confstr(_CS_PATH) if PATH is not found.
Diffstat (limited to 'tests/scripts/misc')
-rw-r--r--tests/scripts/misc/general47
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/scripts/misc/general4 b/tests/scripts/misc/general4
index 263505e4..0077c896 100644
--- a/tests/scripts/misc/general4
+++ b/tests/scripts/misc/general4
@@ -118,4 +118,11 @@ all: ; $sname
unlink($sname);
+# SV 57674: ensure we use a system default PATH if one is not set
+delete $ENV{PATH};
+run_make_test(q!
+a: ; @echo hi
+!,
+ '', "hi\n");
+
1;