GNU bug report logs - #23763
Bug report: Grep stops, if a text file contains a null character after 32768 bytes

Previous Next

Package: grep;

Reported by: Bjoern Voigt <bjoernv <at> arcor.de>

Date: Mon, 13 Jun 2016 19:55:02 UTC

Severity: normal

Tags: notabug

Done: Eric Blake <eblake <at> redhat.com>

Bug is archived. No further changes may be made.

Full log


Message #18 received at 23763 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Bjoern Voigt <bjoernv <at> arcor.de>, 23763 <at> debbugs.gnu.org
Subject: Re: bug#23763: Bug report: Grep stops, if a text file contains a null
 character after 32768 bytes
Date: Mon, 13 Jun 2016 15:19:10 -0700
[Message part 1 (text/plain, inline)]
On 06/13/2016 01:52 PM, Bjoern Voigt wrote:
> The manual page says
> about the auto guessing code:

That's a typo in the man page, and I installed the attached patch to fix 
it. This should address the first four points you mentioned. As for the 
remaining points, grep does not consider binary data to be an error. 
Although there is a judgment call as to whether a matching-lines 
notification should be sent to stdout or stderr when input contains 
binary data, grep has been behaving this way for some time (GNU diff 
even longer) and it would be a hassle to change it at this point.

For GNU grep, you should be able to work around the issue by using the 
-a option. Other grep implementations may or may not work; in my 
experience, sending NUL bytes to them can sometimes make them dump core 
or artificially truncate their output.

[0001-doc-remove-obsolete-MS-DOS-mention.patch (application/x-patch, attachment)]

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

Previous Next


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