9
0
Fork 0

setenv: be robust against setenv(<var>, NULL)

Handle value == NULL similiar to how value == '' is currently handled.
hush's builtin_getopt() seems to trigger this for OPTARG.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Peter Korsgaard 2011-05-14 22:33:51 +02:00 committed by Sascha Hauer
parent 33e3d1d365
commit e7ed69d570
1 changed files with 1 additions and 1 deletions

View File

@ -205,7 +205,7 @@ int setenv(const char *_name, const char *value)
struct variable_d *var;
int ret = 0;
if (!*value)
if (value && !*value)
value = NULL;