GNU bug report logs - #23234
unexpected results with charset handling in GNU grep 2.23

Previous Next

Package: grep;

Reported by: Björn JACKE <bjoern <at> j3e.de>

Date: Wed, 6 Apr 2016 20:45:01 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Eric Blake <eblake <at> redhat.com>, Bjoern Jacke <bjoern <at> j3e.de>, 23234 <at> debbugs.gnu.org
Subject: bug#23234: unexpected results with charset handling in GNU grep 2.23
Date: Wed, 6 Apr 2016 18:25:16 -0700
On 04/06/2016 04:15 PM, Eric Blake wrote:
> And yes, maybe we could change grep to print the "Binary file matches"
> message to stderr, but that in turn will probably break other scripts,
> and lead to even more complaints from people doing non-standard things
> and expecting consistent results.

Yes, I'm dubious about this idea. grep's behavior was inspired by diff's 
similar behavior, and grep and diff have worked that way for many years 
and I expect people depend on it. POSIX says that diff should output its 
binary-file message to stdout, and I expect that if POSIX standardized 
grep's behavior on binary files it would do something similar.

> Maybe changing the exit status when a binary file is encountered is
> worth doing

Possibly, though I don't see the use case yet. If it's needed I suggest 
doing the change only if a new option is specified 
(--binary-files=error, say) so that it's upward-compatible with existing 
behavior.




This bug report was last modified 9 years and 46 days ago.

Previous Next


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