summaryrefslogtreecommitdiff
path: root/common/cmd_nvedit.c
diff options
context:
space:
mode:
authorPierre Aubert <p.aubert@staubli.com>2013-10-08 14:20:27 +0200
committerTom Rini <trini@ti.com>2013-11-08 15:25:14 -0500
commit9a8323311ca500579b86905fcf539f17c193ce25 (patch)
tree1dd161d5401fb5cf2a5c7c89ea683a34486828ae /common/cmd_nvedit.c
parent2a19de42eca547ceff341cce3810f3a9d795ef96 (diff)
downloadu-boot-imx-9a8323311ca500579b86905fcf539f17c193ce25.zip
u-boot-imx-9a8323311ca500579b86905fcf539f17c193ce25.tar.gz
u-boot-imx-9a8323311ca500579b86905fcf539f17c193ce25.tar.bz2
env: fix the env export varname
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>
Diffstat (limited to 'common/cmd_nvedit.c')
-rw-r--r--common/cmd_nvedit.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 0d4d02c..5bcc324 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -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