Fixed -qv interaction (thanks to a report and patch from David Douthitt).

This commit is contained in:
Matt Kraai 2001-01-04 15:11:52 +00:00
parent 09acc06c10
commit 0810f723b1
2 changed files with 10 additions and 0 deletions

View File

@ -85,6 +85,11 @@ static void grep_file(FILE *file)
} }
else if (ret == REG_NOMATCH && invert_search) { else if (ret == REG_NOMATCH && invert_search) {
if (be_quiet) {
regfree(&regex);
exit(0);
}
nmatches++; nmatches++;
print_matched_line(line, linenum); print_matched_line(line, linenum);
} }

5
grep.c
View File

@ -85,6 +85,11 @@ static void grep_file(FILE *file)
} }
else if (ret == REG_NOMATCH && invert_search) { else if (ret == REG_NOMATCH && invert_search) {
if (be_quiet) {
regfree(&regex);
exit(0);
}
nmatches++; nmatches++;
print_matched_line(line, linenum); print_matched_line(line, linenum);
} }