]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
env: fix the env export varname
authorPierre Aubert <p.aubert@staubli.com>
Tue, 8 Oct 2013 12:20:27 +0000 (14:20 +0200)
committerTom Rini <trini@ti.com>
Fri, 8 Nov 2013 20:25:14 +0000 (15:25 -0500)
The env export command doesn't export the first variable of the list
since commit 5a31ea04c9ee5544fbb70ad7597ea4b294840eab
"env grep" - reimplement command using hexport_r()

Signed-off-by: Pierre Aubert <p.aubert@staubli.com>
common/cmd_nvedit.c
lib/hashtable.c

index 0d4d02cfe0a1eb91ecd39bb6c9edfcc502e8225a..5bcc324675eb7535c9e103cd473134122b83e376 100644 (file)
@@ -157,10 +157,8 @@ static int do_env_grep(cmd_tbl_t *cmdtp, int flag,
        grep_how  = H_MATCH_SUBSTR;     /* default: substring search    */
        grep_what = H_MATCH_BOTH;       /* default: grep names and values */
 
-       while (argc > 1 && **(argv + 1) == '-') {
-               char *arg = *++argv;
-
-               --argc;
+       while (--argc > 0 && **++argv == '-') {
+               char *arg = *argv;
                while (*++arg) {
                        switch (*arg) {
 #ifdef CONFIG_REGEX
index c5a2b08becf4e9e0ebfac9708f178b8575812ffe..4356b234ececa2ec586da0198d5306f5de6114f9 100644 (file)
@@ -564,7 +564,7 @@ static int match_entry(ENTRY *ep, int flag,
        int arg;
        void *priv = NULL;
 
-       for (arg = 1; arg < argc; ++arg) {
+       for (arg = 0; arg < argc; ++arg) {
 #ifdef CONFIG_REGEX
                struct slre slre;