From: Jeffrey Mann Date: Mon, 23 Apr 2007 12:00:11 +0000 (+0200) Subject: [patch] setenv(...) can delete environmentalvariables X-Git-Tag: v1.3.0-rc1~47^2~11^2~1^2~6 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=afb903a2eb9436baa9270ccc0c27082d86497d89;p=u-boot [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 Acked-by: Stefan Roese --- diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c old mode 100644 new mode 100755 index 9834ba65b7..977ec5bae9 --- 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[])