summaryrefslogtreecommitdiffstats
path: root/common/env.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2011-05-14 22:33:51 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2011-05-16 08:22:29 +0200
commite7ed69d570b9624e7f645e5d6d91340f65899a4e (patch)
tree8085c4c4a89895af39d7f19dcff28a7af82e35a5 /common/env.c
parent33e3d1d3652f0dde92250d85c52b13bf3476e6e8 (diff)
downloadbarebox-e7ed69d570b9624e7f645e5d6d91340f65899a4e.tar.gz
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>
Diffstat (limited to 'common/env.c')
-rw-r--r--common/env.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/env.c b/common/env.c
index b72b5d1..47cef05 100644
--- a/common/env.c
+++ b/common/env.c
@@ -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;