(target_environment): Don't use shell_var if its `value' field is NULL.

This commit is contained in:
Eli Zaretskii 2008-01-26 13:51:14 +00:00
parent 2750526aa5
commit 8d5b3d4298

View file

@ -918,15 +918,18 @@ target_environment (struct file *file)
break; break;
case v_noexport: 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"))
{ {
/* 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; extern struct variable shell_var;
if (streq (v->name, "SHELL") && shell_var.value)
{
v = &shell_var; v = &shell_var;
break; break;
} }
continue; continue;
}
case v_ifset: case v_ifset:
if (v->origin == o_default) if (v->origin == o_default)