diff options
author | Eli Zaretskii <eliz@gnu.org> | 2008-01-26 13:51:14 +0000 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2008-01-26 13:51:14 +0000 |
commit | 719063321a651f94ebbccd4d62fa1af1a9ed45a8 (patch) | |
tree | 1fa8ed1b3b60dbdfcab512aa369c91c8b435f8dd /variable.c | |
parent | 828957e2a2f719b1676885dc8fd54f4d718d91b6 (diff) | |
download | make-719063321a651f94ebbccd4d62fa1af1a9ed45a8.tar.gz |
(target_environment): Don't use shell_var if its `value' field is NULL.
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -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) |