diff options
author | Jeffrey Mann <mannj@embeddedplanet.com> | 2007-04-23 14:00:11 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2007-05-05 21:30:20 +0200 |
commit | 9ffd451afeb08e5be7ddae680487ec962b2bca25 (patch) | |
tree | bb472075299e88155d5384192c9cde337c38364e | |
parent | ebd0a0ae05a44769c4e27458ad4e9f3438250443 (diff) | |
download | u-boot-imx-9ffd451afeb08e5be7ddae680487ec962b2bca25.zip u-boot-imx-9ffd451afeb08e5be7ddae680487ec962b2bca25.tar.gz u-boot-imx-9ffd451afeb08e5be7ddae680487ec962b2bca25.tar.bz2 |
[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>
-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 9834ba6..977ec5b 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[]) |