Fixed option parsing. Grep would continue grepping, even when given a bad /
invalid option. Closes bug #1146.
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 @@
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 @@
before_buf = (char **)calloc(lines_before, sizeof(char *));
break;
#endif /* BB_FEATURE_GREP_CONTEXT */
+ default:
+ show_usage();
}
}