summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-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 0d4d02cfe0..5bcc324675 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