cmd: nvedit: propagate envflag to set_default_vars

The env_flag in do_env_default() doesn't get propagated and therefore
gets ignored by himport_r(). This breaks to ability to "forcibly" reset
variables to their default values using the environment command.

Scenario example of the problem:
	# setenv kernel uImage
	# setenv .flags kernel:so
	# env default -f kernel
	## Error: Can't overwrite "kernel"
	himport_r: can't insert "kernel=zImage" into hash table

Change the call path so it will pass the flag correctly.

Signed-off-by: Yaniv Levinsky <yaniv.levinsky@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
This commit is contained in:
Yaniv Levinsky
2018-06-24 19:16:55 +03:00
committed by Tom Rini
parent 30091494eb
commit 477f8116d5
3 changed files with 5 additions and 4 deletions

View File

@@ -275,7 +275,7 @@ char *env_get_default(const char *name);
void set_default_env(const char *s);
/* [re]set individual variables to their value in the default environment */
int set_default_vars(int nvars, char * const vars[]);
int set_default_vars(int nvars, char * const vars[], int flags);
/* Import from binary representation into hash table */
int env_import(const char *buf, int check);