GNU bug report logs -
#23234
unexpected results with charset handling in GNU grep 2.23
Previous Next
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
Message #32 received at 23234 <at> debbugs.gnu.org (full text, mbox):
On Wed, 6 Apr 2016 18:25:16 -0700
Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> 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.
Hmm, diff does not output "Binary file matches" between text files, but
grep does it.
$ cp src/grep grep.bin
$ LC_ALL=en_US.utf8 src/grep g grep.bin
Binary file grep.bin matches
$ cat >grep.bin <<EOF
Binary file grep.bin matches
EOF
$ LC_ALL=en_US.utf8 src/grep g grep.bin
Binary file grep.bin matches
When a user got "Binary file matches" from grep, he can distinguish
whether matched a binary file or a line including "Binary file matches"
of a text file from only this result.
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.