GNU bug report logs - #51669
some patterns which should match 0x0 don’t do so

Previous Next

Package: grep;

Reported by: Christoph Anton Mitterer <calestyo <at> scientia.org>

Date: Sun, 7 Nov 2021 17:30:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

Full log


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

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Christoph Anton Mitterer <calestyo <at> scientia.org>
Cc: 51669 <at> debbugs.gnu.org
Subject: Re: bug#51669: some patterns which should match 0x0 don’t do so
Date: Sun, 7 Nov 2021 23:20:24 -0800
On 11/7/21 16:45, Christoph Anton Mitterer wrote:

> why is 0x00 different from 0x02?
POSIX says text files cannot contain NUL bytes. They can contain 0x02 
bytes, though.

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_403

More generally, in a POSIX system any method for deciding whether a file 
is text vs binary is to some extent a heuristic, and there will always 
be corners in any such heuristic.




This bug report was last modified 3 years and 251 days ago.

Previous Next


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