* src/printf.c: Document that \0 can be followed by 0 to 3 octal digits * doc/coreutils.texi: Change "\0OOO" to "\0NNN" for legibility and consistency with man page and help message. Remove extraneous '\'. --- doc/coreutils.texi | 4 ++-- src/printf.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 00e401cbd..51e06527c 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -13438,8 +13438,8 @@ one. An additional directive @samp{%b}, prints its argument string with @samp{\} escapes interpreted in the same way as in the @var{format} string, except that octal escapes are of the form -@samp{\0@var{ooo}} where @var{ooo} is 0 to 3 octal digits. If -@samp{\@var{ooo}} is nine-bit value, ignore the ninth bit. +@samp{\0@var{NNN}} where @var{NNN} is 0 to 3 octal digits. If +@var{NNN} is nine-bit value, ignore the ninth bit. If a precision is also given, it limits the number of bytes printed from the converted string. diff --git a/src/printf.c b/src/printf.c index 7ac7a76ce..114288796 100644 --- a/src/printf.c +++ b/src/printf.c @@ -39,7 +39,8 @@ Additional directive: %b = print an argument string, interpreting backslash escapes, - except that octal escapes are of the form \0 or \0ooo. + except that octal escapes are of the form \0 or \0NNN, where + NNN is 0 to 3 octal digits. %q = print an argument string in a format that can be reused as shell input. Escaped characters used the @@ -124,7 +125,8 @@ FORMAT controls the output as in C printf. Interpreted sequences are:\n\ fputs (_("\ %% a single %\n\ %b ARGUMENT as a string with '\\' escapes interpreted,\n\ - except that octal escapes are of the form \\0 or \\0NNN\n\ + except that octal escapes are of the form \\0NNN,\n\ + where NNN is 0 to 3 octal digits.\n\ %q ARGUMENT is printed in a format that can be reused as shell input,\n\ escaping non-printable characters with the POSIX $'' syntax.\ \n\n\ -- 2.46.0