POSIX requires the current behavior, where the argument that matches up to %c
is treated as a string and the first character of that string is printed. So,
unfortunately, your patch cannot be accepted without violating POSIX semantics
for printf(1). What would be useful, however, is a documentation patch that
makes this behavior clear in both the info pages and the --help output (right
now, the info pages assume that you already know how printf(3) works, which is
not as useful as it could be; and fails to mention that %c parses its argument
as a string and not a C constant integer). I'm leaving this patch open as a
reminder that a doc patch is needed."
So it seems what is really needed is to update the documentation.
I looked up this on the coreutils mailing list (the nearer they have to a BTS, and there is this entry: http:// lists.gnu. org/archive/ html/bug- coreutils/ 2006-01/ msg00070. html about this behaviour:
"Update of patch #3286 (project coreutils):
___ _______ _______ _______ _______ _______ _______ _______ ___
Follow-up Comment #1:
POSIX requires the current behavior, where the argument that matches up to %c
is treated as a string and the first character of that string is printed. So,
unfortunately, your patch cannot be accepted without violating POSIX semantics
for printf(1). What would be useful, however, is a documentation patch that
makes this behavior clear in both the info pages and the --help output (right
now, the info pages assume that you already know how printf(3) works, which is
not as useful as it could be; and fails to mention that %c parses its argument
as a string and not a C constant integer). I'm leaving this patch open as a
reminder that a doc patch is needed."
So it seems what is really needed is to update the documentation.