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

Re: t0050-filesystem.sh unicode tests borked on dash shell

From
Thomas Rast <trast@student.ethz.ch>
Date
Dec 21, 2010, 20:29 UTC
Message-ID
<201012212129.39141.trast@student.ethz.ch>
In-Reply-To
<4D1105B5.5070703@ramsay1.demon.co.uk>
Ramsay Jones wrote:
>     $ ls trash\ directory.t0050-filesystem/unicode/
>     \x61\xcc\x88

The printf at the top evidently does not interpolate \xAA sequences. Since my 'man 1p printf' POSIX manpage only mandates \AAA octal sequences, maybe we should use that instead. Can you verify that the patch below works for you?

Judging from
  git grep '\\x[0-9a-f][0-9a-f]' t
this is the only instance of this problem, the rest are in Perl code.
--- 8< ---
Subject: t0050: replace \xAA by \AAA in printf

POSIX does not mandate the hex escape sequences, and thus dash's built-in printf does not expand them. Use octal escapes instead.

diff --git c/t/t0050-filesystem.sh i/t/t0050-filesystem.sh
index 057c97c..87bf1ff 100755
--- c/t/t0050-filesystem.sh
+++ i/t/t0050-filesystem.sh
@@ -4,8 +4,8 @@ test_description='Various filesystem issues'
 
 . ./test-lib.sh
 
-auml=`printf '\xc3\xa4'`
-aumlcdiar=`printf '\x61\xcc\x88'`
+auml=`printf '\303\244'`
+aumlcdiar=`printf '\141\314\210'`
 
 case_insensitive=
 unibad=
-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Ramsay JonesNext: Junio C Hamano
Message 5 of 6 in “t0050-filesystem.sh unicode tests borked on dash shell”
  1. Ramsay JonesDec 21, 2010
  2. t0050: fix printf format strings for portabilityJonathan Nieder, Dec 21, 2010
  3. Junio C HamanoDec 21, 2010
  4. Ramsay JonesDec 28, 2010
  5. Thomas RastDec 21, 2010
  6. Junio C HamanoDec 21, 2010

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.