GNU bug report logs - #22838
New 'Binary file' detection considered harmful

Previous Next

Package: grep;

Reported by: Marcello Perathoner <marcello <at> perathoner.de>

Date: Sun, 28 Feb 2016 18:13:01 UTC

Severity: normal

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #67 received at 22838-done <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 22838-done <at> debbugs.gnu.org, Eric Blake <eblake <at> redhat.com>,
 Hans Pelleboer <hanspelleboer <at> online.nl>,
 Marcello Perathoner <marcello <at> perathoner.de>,
 Bruce Dubbs <bruce.dubbs <at> gmail.com>
Subject: Re: bug#22838: New 'Binary file' detection considered harmful
Date: Thu, 8 Sep 2016 22:20:36 -0700
On Thu, Sep 8, 2016 at 6:43 PM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> 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.

Very nice.  Thank you!




This bug report was last modified 8 years and 256 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.