commit 036449cdf13b5fd9364f7b9cc910fce7923ee4bf
parent 5b92551057a694bb8796efcf7852b6845398d541
Author: Richard Ipsum <richardipsum@fastmail.co.uk>
Date: Mon, 20 May 2019 17:21:08 +0100
grep: Fix exit status on use of -l
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grep.c b/grep.c
@@ -135,6 +135,7 @@ grep(FILE *fp, const char *str)
}
}
if (match != vflag) {
+ result = Match;
switch (mode) {
case 'c':
c++;
@@ -152,7 +153,6 @@ grep(FILE *fp, const char *str)
puts(buf);
break;
}
- result = Match;
}
}
if (mode == 'c')