diff options
author | Jeffrey Mann | 2007-04-23 14:00:11 +0200 |
---|---|---|
committer | Wolfgang Denk | 2007-05-05 21:30:20 +0200 |
commit | 9ffd451afeb08e5be7ddae680487ec962b2bca25 (patch) | |
tree | bb472075299e88155d5384192c9cde337c38364e /common | |
parent | ebd0a0ae05a44769c4e27458ad4e9f3438250443 (diff) |
[patch] setenv(...) can delete environmentalvariables
update setenv() function so that entering a NULL value for the
variable's value will delete the environmental variable
Signed-off-by: Jeffrey Mann <mannj@embeddedplanet.com>
Acked-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_nvedit.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c index 9834ba65b7d..977ec5bae96 100644 --- a/common/cmd_nvedit.c +++ b/common/cmd_nvedit.c @@ -391,7 +391,10 @@ int _do_setenv (int flag, int argc, char *argv[]) void setenv (char *varname, char *varvalue) { char *argv[4] = { "setenv", varname, varvalue, NULL }; - _do_setenv (0, 3, argv); + if (varvalue == NULL) + _do_setenv (0, 2, argv); + else + _do_setenv (0, 3, argv); } int do_setenv ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]) |