* 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:
Eli Zaretskii 2009-09-14 18:18:37 +00:00
parent 958ea92eb8
commit 295a05fbd6

View file

@ -441,13 +441,14 @@ process_begin(
/* Use the Makefile's value of PATH to look for the program to /* Use the Makefile's value of PATH to look for the program to
execute, because it could be different from Make's PATH execute, because it could be different from Make's PATH
(e.g., if the target sets its own value. */ (e.g., if the target sets its own value. */
for (ep = envp; ep; ep++) { if (envp)
if (strncmp (*ep, "PATH=", 5) == 0 for (ep = envp; *ep; ep++) {
|| strncmp (*ep, "Path=", 5) == 0) { if (strncmp (*ep, "PATH=", 5) == 0
path_var = *ep + 5; || strncmp (*ep, "Path=", 5) == 0) {
break; path_var = *ep + 5;
break;
}
} }
}
exec_handle = find_file(exec_path, path_var, exec_handle = find_file(exec_path, path_var,
exec_fname, sizeof(exec_fname)); exec_fname, sizeof(exec_fname));