[hackers] [sbase] grep: Fix exit status on use of -l || Richard Ipsum

From: <git_AT_suckless.org>
Date: Mon, 20 May 2019 21:43:19 +0200 (CEST)

commit 036449cdf13b5fd9364f7b9cc910fce7923ee4bf
Author: Richard Ipsum <richardipsum_AT_fastmail.co.uk>
AuthorDate: Mon May 20 17:21:08 2019 +0100
Commit: Michael Forney <mforney_AT_mforney.org>
CommitDate: Mon May 20 12:38:54 2019 -0700

    grep: Fix exit status on use of -l

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')
Received on Mon May 20 2019 - 21:43:19 CEST

This archive was generated by hypermail 2.3.0 : Mon May 20 2019 - 21:48:25 CEST