[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22838: New 'Binary file' detection considered harmful

From: Paul Eggert
Subject: bug#22838: New 'Binary file' detection considered harmful
Date: Thu, 8 Sep 2016 18:43:43 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

Paul Eggert wrote:
On 03/01/2016 02:05 AM, Marcello Perathoner wrote:
2) If you just output

   binary line 42 in file x matches

and continue regular output after the next newline, the breakage would be much
more confined.

This sounds like a good suggestion.  That is, grep could keep going if its only
problem is an attempt to output encoding errors (as opposed to reading null
bytes, which are a more-reliable indication of binary data).  It would probably
be better to output just one "Binary file matches" line per file, at the end of
the other matches, so that it's more likely to be noticed.

I finally got around to implementing this, which turned out to be considerably easier than I thought it would be. I installed the attached patch into the grep Savannah master. I am boldly closing this old bug report; we can always start a new report if further problems turn up.

Attachment: 0001-grep-encoding-errors-suppress-just-their-line.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]