[hackers] [PATCH][sbase] grep: Fix exit status on use of -l

From: Richard Ipsum <richardipsum_AT_fastmail.co.uk>
Date: Mon, 20 May 2019 17:21:08 +0100

---
 grep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grep.c b/grep.c
index c322a32..1c97807 100644
--- a/grep.c
+++ b/grep.c
_AT_@ -135,6 +135,7 @@ grep(FILE *fp, const char *str)
 			}
 		}
 		if (match != vflag) {
+			result = Match;
 			switch (mode) {
 			case 'c':
 				c++;
_AT_@ -152,7 +153,6 @@ grep(FILE *fp, const char *str)
 				puts(buf);
 				break;
 			}
-			result = Match;
 		}
 	}
 	if (mode == 'c')
-- 
2.21.0
Received on Mon May 20 2019 - 18:21:08 CEST

This archive was generated by hypermail 2.3.0 : Mon May 20 2019 - 18:24:24 CEST