diff options
-rw-r--r-- | findutils/grep.c | 5 | ||||
-rw-r--r-- | grep.c | 5 |
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(®ex); + exit(0); + } + nmatches++; print_matched_line(line, linenum); } @@ -85,6 +85,11 @@ static void grep_file(FILE *file) } else if (ret == REG_NOMATCH && invert_search) { + if (be_quiet) { + regfree(®ex); + exit(0); + } + nmatches++; print_matched_line(line, linenum); } |