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~85 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9ffd451afeb08e5be7ddae680487ec962b2bca25;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 index 9834ba65b7..977ec5bae9 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[])