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.
break;
}
+ /* execvp() will use a default PATH if none is set; emulate that. */
+ if (p == NULL)
+ {
+ size_t l = confstr (_CS_PATH, NULL, 0);
+ if (l)
+ {
+ char *dp = alloca (l);
+ confstr (_CS_PATH, dp, l);
+ p = dp;
+ }
+ }
+
cmd = (char *)find_in_given_path (argv[0], p, 0);
}
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;