From: Eli Zaretskii Date: Sat, 26 Jan 2008 13:51:14 +0000 (+0000) Subject: (target_environment): Don't use shell_var if its `value' field is NULL. X-Git-Tag: 3.82~91 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d5b3d429888da22e38d4f62fd7ae0c15e9980fe;p=thirdparty%2Fmake.git (target_environment): Don't use shell_var if its `value' field is NULL. --- diff --git a/variable.c b/variable.c index 25491c4f..3dc8a228 100644 --- a/variable.c +++ b/variable.c @@ -918,15 +918,18 @@ target_environment (struct file *file) break; case v_noexport: - /* If this is the SHELL variable and it's not exported, then - add the value from our original environment. */ - if (streq (v->name, "SHELL")) - { - extern struct variable shell_var; - v = &shell_var; - break; - } - continue; + { + /* If this is the SHELL variable and it's not exported, + then add the value from our original environment, if + the original environment defined a value for SHELL. */ + extern struct variable shell_var; + if (streq (v->name, "SHELL") && shell_var.value) + { + v = &shell_var; + break; + } + continue; + } case v_ifset: if (v->origin == o_default)