grep: Fix exit status on use of -l

This commit is contained in:
Richard Ipsum 2019-05-20 17:21:08 +01:00 committed by Michael Forney
parent 5b92551057
commit 036449cdf1
1 changed files with 1 additions and 1 deletions

2
grep.c
View File

@ -135,6 +135,7 @@ grep(FILE *fp, const char *str)
} }
} }
if (match != vflag) { if (match != vflag) {
result = Match;
switch (mode) { switch (mode) {
case 'c': case 'c':
c++; c++;
@ -152,7 +153,6 @@ grep(FILE *fp, const char *str)
puts(buf); puts(buf);
break; break;
} }
result = Match;
} }
} }
if (mode == 'c') if (mode == 'c')