env: add more debug message for env_update() and env_append()
Change-Id: I0d798d91f2bc132accac882ccfeec76d2f6a747e Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
This commit is contained in:
parent
b99d793163
commit
526c692b8e
11
cmd/nvedit.c
11
cmd/nvedit.c
|
|
@ -312,9 +312,12 @@ static int env_append(const char *varname, const char *varvalue)
|
|||
if (oldvalue) {
|
||||
len += strlen(oldvalue);
|
||||
/* Exist ! */
|
||||
if (strstr(oldvalue, varvalue))
|
||||
if (strstr(oldvalue, varvalue)) {
|
||||
debug("%s: '%s' is already exist in '%s'\n",
|
||||
__func__, varvalue, varname);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
newvalue = malloc(len + 2);
|
||||
if (!newvalue) {
|
||||
|
|
@ -499,9 +502,11 @@ int env_update(const char *varname, const char *varvalue)
|
|||
}
|
||||
|
||||
/* Not find, just append */
|
||||
if (!match)
|
||||
if (!match) {
|
||||
debug("%s: append '%s' to the '%s' end\n",
|
||||
__func__, v_item, varname);
|
||||
env_append(varname, v_item);
|
||||
|
||||
}
|
||||
match = false;
|
||||
free(v_item_tok);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue