(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 this is the SHELL variable and it's not exported,
if (streq (v->name, "SHELL")) 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;
v = &shell_var; if (streq (v->name, "SHELL") && shell_var.value)
break; {
} v = &shell_var;
continue; break;
}
continue;
}
case v_ifset: case v_ifset:
if (v->origin == o_default) if (v->origin == o_default)