aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-01-04 15:11:52 +0000
committerMatt Kraai <kraai@debian.org>2001-01-04 15:11:52 +0000
commit0810f723b137cb73d41b9021b3ea945f98001159 (patch)
tree8aa4290757f512a93ca356ee8f77947c1145d7f6
parent09acc06c106e31841a4246532bbba39da97ce3b1 (diff)
downloadbusybox-0810f723b137cb73d41b9021b3ea945f98001159.tar.gz
Fixed -qv interaction (thanks to a report and patch from David Douthitt).
-rw-r--r--findutils/grep.c5
-rw-r--r--grep.c5
2 files changed, 10 insertions, 0 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 83336613e..69195bfdc 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -85,6 +85,11 @@ static void grep_file(FILE *file)
}
else if (ret == REG_NOMATCH && invert_search) {
+ if (be_quiet) {
+ regfree(&regex);
+ exit(0);
+ }
+
nmatches++;
print_matched_line(line, linenum);
}
diff --git a/grep.c b/grep.c
index 83336613e..69195bfdc 100644
--- a/grep.c
+++ b/grep.c
@@ -85,6 +85,11 @@ static void grep_file(FILE *file)
}
else if (ret == REG_NOMATCH && invert_search) {
+ if (be_quiet) {
+ regfree(&regex);
+ exit(0);
+ }
+
nmatches++;
print_matched_line(line, linenum);
}