]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
cmd: nvedit: set H_INTERACTIVE in do_env_default
authorYaniv Levinsky <yaniv.levinsky@compulab.co.il>
Sun, 24 Jun 2018 16:16:56 +0000 (19:16 +0300)
committerTom Rini <trini@konsulko.com>
Thu, 19 Jul 2018 20:17:58 +0000 (16:17 -0400)
The function set_default_vars() in common.c adds H_INTERACTIVE to the
h_import() flag, but the function has no way of telling if the command
actually was user directed like this flag suggest. The flag should be
set by the calling function do_env_default() in nvedit.c instead, where
the command is certainty user directed.

Move the H_INTERACTIVE flag from set_default_vars() to do_env_default().

Signed-off-by: Yaniv Levinsky <yaniv.levinsky@compulab.co.il>
Acked-by: Igor Grinberg <grinberg@compulab.co.il>
cmd/nvedit.c
env/common.c

index 1955dee0d0241b0cf519ca4457388c5bdd9fa4e2..8b73c606ca6a5fd2f1341fb5cf0089df4f78ea67 100644 (file)
@@ -780,7 +780,7 @@ int envmatch(uchar *s1, int i2)
 static int do_env_default(cmd_tbl_t *cmdtp, int flag,
                          int argc, char * const argv[])
 {
-       int all = 0, env_flag = 0;
+       int all = 0, env_flag = H_INTERACTIVE;
 
        debug("Initial value for argc=%d\n", argc);
        while (--argc > 0 && **++argv == '-') {
index 6cf5eddaf65353965c36a8eb0df052df9610c515..05183a4af07d1ccc3e17ba5fdf0f5b16591961df 100644 (file)
@@ -97,7 +97,7 @@ 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;
+       flags |= H_NOCLEAR;
        return himport_r(&env_htab, (const char *)default_environment,
                                sizeof(default_environment), '\0',
                                flags, 0, nvars, vars);