mirror of
https://git.savannah.gnu.org/git/make.git
synced 2024-11-24 20:20:35 +00:00
* w32/subproc/sub_proc.c (process_begin): Check *ep non-NULL
inside the loop that looks up environment for PATH.
This commit is contained in:
parent
958ea92eb8
commit
295a05fbd6
1 changed files with 7 additions and 6 deletions
|
@ -441,13 +441,14 @@ process_begin(
|
|||
/* Use the Makefile's value of PATH to look for the program to
|
||||
execute, because it could be different from Make's PATH
|
||||
(e.g., if the target sets its own value. */
|
||||
for (ep = envp; ep; ep++) {
|
||||
if (strncmp (*ep, "PATH=", 5) == 0
|
||||
|| strncmp (*ep, "Path=", 5) == 0) {
|
||||
path_var = *ep + 5;
|
||||
break;
|
||||
if (envp)
|
||||
for (ep = envp; *ep; ep++) {
|
||||
if (strncmp (*ep, "PATH=", 5) == 0
|
||||
|| strncmp (*ep, "Path=", 5) == 0) {
|
||||
path_var = *ep + 5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
exec_handle = find_file(exec_path, path_var,
|
||||
exec_fname, sizeof(exec_fname));
|
||||
|
||||
|
|
Loading…
Reference in a new issue