aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/nvedit.c2
-rw-r--r--env/common.c5
-rw-r--r--include/environment.h2
3 files changed, 5 insertions, 4 deletions
diff --git a/cmd/nvedit.c b/cmd/nvedit.c
index d456d2fc9ba..1955dee0d02 100644
--- a/cmd/nvedit.c
+++ b/cmd/nvedit.c
@@ -807,7 +807,7 @@ static int do_env_default(cmd_tbl_t *cmdtp, int flag,
}
if (!all && (argc > 0)) {
/* Reset individual variables */
- set_default_vars(argc, argv);
+ set_default_vars(argc, argv, env_flag);
return 0;
}
diff --git a/env/common.c b/env/common.c
index dc8a14f5190..6cf5eddaf65 100644
--- a/env/common.c
+++ b/env/common.c
@@ -91,15 +91,16 @@ 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)
{
/*
* Special use-case: import from default environment
* (and use \0 as a separator)
*/
+ flags |= H_NOCLEAR | H_INTERACTIVE;
return himport_r(&env_htab, (const char *)default_environment,
sizeof(default_environment), '\0',
- H_NOCLEAR | H_INTERACTIVE, 0, nvars, vars);
+ flags, 0, nvars, vars);
}
/*
diff --git a/include/environment.h b/include/environment.h
index 70b7eda428b..2fe1f3eb485 100644
--- a/include/environment.h
+++ b/include/environment.h
@@ -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);