bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#7574: [PATCH]: echo, printf, stat: Allow only up to 8 bit octal inpu


From: Eric Blake
Subject: bug#7574: [PATCH]: echo, printf, stat: Allow only up to 8 bit octal input for backslash-escaped chars
Date: Fri, 14 Jan 2011 08:07:56 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7

On 01/14/2011 06:32 AM, Ondrej Vasik wrote:
> As the same bash request for change in builtin echo and printf
> (http://lists.gnu.org/archive/html/bug-bash/2010-12/msg00030.html and
> https://www.opengroup.org/sophocles/show_mail.tpl?CALLER=show_archive.tpl&source=L&listname=austin-group-l&id=15087
>  ) was rejected, I think we should do the same here to keep echo and printf 
> implementations as close as possible.
> 
> Anyway, it would be better to be consistent in all utilities -e.g.
> tr.c:502 now behaves the way proposed in the patch in this bugzilla -
> and at least document that the ninth bit is ignored in the address@hidden
> section of info documentation.

The POSIX decision was to document that \400 has unspecified behavior
(meaning the ninth bit can be ignored, an error issued, the string
treated as \40 followed by a literal 0, or any other action).  It
doesn't bother me if we differ slightly from bash, as the behavior is
already undefined and people should not be relying on it.

http://austingroupbugs.net/view.php?id=249

        If more than two hexadecimal digits immediately follow \x or
        if the octal value specified by \XXX will not fit in a byte, the
        results are unspecified.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]