Ben Harris wrote:
First, thanks for the bug report. But I think one of us is misreading
the document.
> IEEE Std 1003.1, 2003 Edition states that in printf(1) format strings:
>
> # ... "\ddd" , where ddd is a one, two, or three-digit octal number,
> # shall be written as a byte with the numeric value specified by the
> # octal number.
> <http://www.opengroup.org/onlinepubs/009696899/utilities/printf.html>
Are you refering to this item?
"\0ddd" , where ddd is a zero, one, two, or three-digit octal
number that shall be converted to a byte with the numeric value
specified by the octal number
> But the version of printf(1) in GNU coreutils 5.0 (tested on a build from
> clean GNU sources under Debian GNU/Linux i386 sarge) fails to correctly
> handle such sequences unless the first digit is '0':
>
> $ POSIXLY_CORRECT=1 _POSIX2_VERSION=200112 ./src/printf '\41\n'
> \41
As per the specification. What am I missing?
Bob