From af79b17356f2edeca2908c14d922a24f659d4a96 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 20 Nov 2021 22:53:55 -0800 Subject: =?UTF-8?q?grep:=20-s=20does=20not=20suppress=20=E2=80=9Cbinary=20?= =?UTF-8?q?file=20matches=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/grep.c (grep): Implement this. * tests/binary-file-matches: Add regression test. --- src/grep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/grep.c b/src/grep.c index a55194cf..19dff43e 100644 --- a/src/grep.c +++ b/src/grep.c @@ -1646,7 +1646,7 @@ grep (int fd, struct stat const *st, bool *ineof) finish_grep: done_on_match = done_on_match_0; out_quiet = out_quiet_0; - if (binary_files == BINARY_BINARY_FILES && ! (out_quiet | suppress_errors) + if (binary_files == BINARY_BINARY_FILES && !out_quiet && (encoding_error_output || (0 <= nlines_first_null && nlines_first_null < nlines))) error (0, 0, _("%s: binary file matches"), input_filename ()); -- cgit v1.2.1