summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Whitley2001-04-09 23:00:07 +0000
committerMark Whitley2001-04-09 23:00:07 +0000
commit4391a16c92cef744fc715cb7347b7b71fc8f312e (patch)
treeb5d0ca9bb0b258199e9b22e24355cf398bf6b7be
parente5dfced23a904d08afa5dcee190c3c3d845d9f50 (diff)
downloadbusybox-4391a16c92cef744fc715cb7347b7b71fc8f312e.zip
busybox-4391a16c92cef744fc715cb7347b7b71fc8f312e.tar.gz
Fixed option parsing. Grep would continue grepping, even when given a bad /
invalid option. Closes bug #1146.
-rw-r--r--findutils/grep.c2
-rw-r--r--grep.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 475b4ef..8c67976 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -232,6 +232,8 @@ extern int grep_main(int argc, char **argv)
before_buf = (char **)calloc(lines_before, sizeof(char *));
break;
#endif /* BB_FEATURE_GREP_CONTEXT */
+ default:
+ show_usage();
}
}
diff --git a/grep.c b/grep.c
index 475b4ef..8c67976 100644
--- a/grep.c
+++ b/grep.c
@@ -232,6 +232,8 @@ extern int grep_main(int argc, char **argv)
before_buf = (char **)calloc(lines_before, sizeof(char *));
break;
#endif /* BB_FEATURE_GREP_CONTEXT */
+ default:
+ show_usage();
}
}