summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Mann <mannj@embeddedplanet.com>2007-04-23 14:00:11 +0200
committerStefan Roese <sr@denx.de>2007-04-23 14:00:11 +0200
commitafb903a2eb9436baa9270ccc0c27082d86497d89 (patch)
tree7ddf51755348c56a55f6170dc83f2e77617c4d68
parent36f104e5caa747d568eff26b369565af57c2ffa6 (diff)
downloadu-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>
-rwxr-xr-x[-rw-r--r--]common/cmd_nvedit.c5
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[])