From bf3ee23890db33e3d0bef5344e896d2cdfaa34aa Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 8 Sep 2016 18:33:14 -0700 Subject: grep: encoding errors suppress just their line From a suggestion by Marcello Perathoner (Bug#22838). * NEWS, doc/grep.texi (File and Directory Selection): Document this. * src/grep.c (print_line_head): Do not suppress later output lines merely because an earlier output line would have had an encoding error. * tests/encoding-error: Test for the new behavior. --- tests/encoding-error | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/encoding-error') diff --git a/tests/encoding-error b/tests/encoding-error index 4b5fcb5b..0cbeffcc 100755 --- a/tests/encoding-error +++ b/tests/encoding-error @@ -35,6 +35,10 @@ grep '^X' in >out test $? = 1 || fail=1 compare /dev/null out || fail=1 +grep . in >out || fail=1 +(cat a j && printf 'Binary file in matches\n') >exp || framework_failure_ +compare exp out || fail=1 + grep -a . in >out || fail=1 compare in out -- cgit v1.2.1