From d65bb028e65d22329619e4e8b49d05c2b2535420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Thu, 26 Nov 2015 19:01:33 +0100 Subject: [PATCH] grep: do not stop on binary data if counting in PCRE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Red Hat bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1269014 Signed-off-by: Jaroslav Å karvada --- src/grep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/grep.c b/src/grep.c index 2c5e09a..957e71d 100644 --- a/src/grep.c +++ b/src/grep.c @@ -1445,7 +1445,8 @@ grep (int fd, struct stat const *st) if (binary_files == WITHOUT_MATCH_BINARY_FILES) return 0; textbin = tb; - done_on_match = out_quiet = true; + if (!count_matches) + done_on_match = out_quiet = true; nul_zapper = eol; skip_nuls = skip_empty_lines; } -- 2.4.3