diff options
author | Jeffrey Mann <mannj@embeddedplanet.com> | 2007-04-23 14:00:11 +0200 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2007-04-23 14:00:11 +0200 |
commit | afb903a2eb9436baa9270ccc0c27082d86497d89 (patch) | |
tree | 7ddf51755348c56a55f6170dc83f2e77617c4d68 /common | |
parent | 36f104e5caa747d568eff26b369565af57c2ffa6 (diff) | |
download | u-boot-imx-afb903a2eb9436baa9270ccc0c27082d86497d89.zip u-boot-imx-afb903a2eb9436baa9270ccc0c27082d86497d89.tar.gz u-boot-imx-afb903a2eb9436baa9270ccc0c27082d86497d89.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>
Diffstat (limited to 'common')
-rwxr-xr-x[-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..100755 --- 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[]) |