git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Fix '\%o' for printf from coreutils

From
Jeff King <peff@peff.net>
Date
Oct 31, 2013, 16:49 UTC
Message-ID
<20131031164920.GA18036@sigill.intra.peff.net>
In-Reply-To
<20131031115131.GA28379@camk.edu.pl>
On Thu, Oct 31, 2013 at 12:51:32PM +0100, Kacper Kornet wrote:
Show 9 quoted lines
> The printf utility provided by coreutils when interpreting '\%o' format
> does not recognize %o as formatting directive. For example
> printf '\%o 0 returns \%o and warning: ignoring excess arguments,
> starting with ‘0’, which results in failed tests in
> t5309-pack-delta-cycles.sh. In most shells the test ends with success as
> the printf is a builtin utility.
> 
> Fix it by using '\\%o' which is interpreted consistently in all versions
> of printf.
Thanks, this makes sense. POSIX says:
     [description of \n, \r, etc...]
     The interpretation of a backslash followed by any other
     sequence of characters is unspecified.

so we were wrong to rely on an unknown backslash-escape being left alone. A quick grep seems indicate that this is the only spot with the problem.

-Peff
Previous: Kacper Kornet
Message 2 of 2 in “Fix '\%o' for printf from coreutils”
  1. Fix '\%o' for printf from coreutilsKacper Kornet, Oct 31, 2013
  2. Jeff KingOct 31, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.