[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sed] bug when matching null bytes
From: |
Paul Eggert |
Subject: |
Re: [sed] bug when matching null bytes |
Date: |
Mon, 21 Aug 2006 10:06:50 -0700 |
User-agent: |
Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux) |
Paolo Bonzini <address@hidden> writes:
> Bert Bos wrote:
>> Hello,
>>
>> I think I found a bug in GNU sed: The "." regular expression doesn't
>> match null bytes.
> This is mandated by POSIX.
No, POSIX says that the input to sed must be a text file, and that
null bytes are not allowed in text files. So if the input contains a
null byte, GNU 'sed' can do whatever it likes. It will still conform
to POSIX even if "." matches a NUL byte.
In both GNU grep and GNU Emacs, "." matches a NUL byte, and there is a
strong argument that GNU "sed" should be consistent with other GNU
tools in this area.
References:
<http://www.opengroup.org/onlinepubs/009695399/utilities/sed.html>
INPUT FILES says "The input files shall be text files."
<http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_392>
says that in a text file "The lines do not contain NUL characters".