summaryrefslogtreecommitdiff
path: root/w32/subproc/sub_proc.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2009-09-14 18:18:37 +0000
committerEli Zaretskii <eliz@gnu.org>2009-09-14 18:18:37 +0000
commit295a05fbd661ae519de7d65887df90cb38d6bd44 (patch)
tree38c803738da4a5d560c12707db119c12a02a7cfe /w32/subproc/sub_proc.c
parent958ea92eb8cf7eeb5af6752805d94b5ae3db99f9 (diff)
downloadgunmake-295a05fbd661ae519de7d65887df90cb38d6bd44.tar.gz
* w32/subproc/sub_proc.c (process_begin): Check *ep non-NULL
inside the loop that looks up environment for PATH.
Diffstat (limited to 'w32/subproc/sub_proc.c')
-rw-r--r--w32/subproc/sub_proc.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/w32/subproc/sub_proc.c b/w32/subproc/sub_proc.c
index a49ccc2..624da46 100644
--- a/w32/subproc/sub_proc.c
+++ b/w32/subproc/sub_proc.c
@@ -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));