Avoid crashes when SHELL=abcde is specified on the command line

* variable.c (do_variable_definition): If $SHELL was not found,
process "SHELL=foo" as any other variable definition.  This avoids
segfaults when SHELL=foo is specified on the Make command line.
Reported by Orgad Shaneh <orgads@gmail.com>.
This commit is contained in:
Eli Zaretskii 2017-06-07 08:32:35 +03:00
parent b552b05251
commit 66a9b5c3ba

View file

@ -1404,6 +1404,11 @@ do_variable_definition (const floc *flocp, const char *varname,
}
}
else
v = NULL;
/* If not $SHELL, or if $SHELL points to a program we didn't find,
just process this variable "as usual". */
if (!v)
#endif
/* If we are defining variables inside an $(eval ...), we might have a