On 08/12/2025 21:37, Bruno Haible via GNU coreutils General Discussion wrote:
Hi,

The tests/ls/hyperlink.sh, that was enhanced in commit
2d07c26d95f36b47ae969edbf83dbff3fed3f960, failed in the CI build of
today, on FreeBSD 14.0. It did not fail a week ago.

Find attached the relevant part of test-suite.log.

In two places, it produced "invalidutf8xe9" instead of the expected
"invalidutf8%e9".


Ah there were a few instances of non-portable printf \x usage.
I've pushed the attached to address that.

thanks!
Padraig
From 2692d599ec46696dcd69458abb75c9c6a9dd0221 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <[email protected]>
Date: Mon, 8 Dec 2025 22:32:48 +0000
Subject: [PATCH] tests: fix non-portable use of printf '\x..'

* tests/dd/conv-case.sh: Use octal instead.
* tests/ls/hyperlink.sh: Likewise.
* tests/sort/sort-locale.sh: Likewise.
---
 tests/dd/conv-case.sh     | 4 ++--
 tests/ls/hyperlink.sh     | 2 +-
 tests/sort/sort-locale.sh | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/dd/conv-case.sh b/tests/dd/conv-case.sh
index d6ece8a2d..a65d1d58d 100755
--- a/tests/dd/conv-case.sh
+++ b/tests/dd/conv-case.sh
@@ -38,8 +38,8 @@ export LC_ALL=en_US.iso8859-1  # only lowercase form works on macOS 10.15.7
 if test "$(locale charmap 2>/dev/null | sed 's/iso/ISO-/')" = ISO-8859-1; then
   # Case conversion should work on all single byte locales.
   # Check it with é and É in ISO 8859-1.
-  printf '\xe9\n' > input-lower
-  printf '\xc9\n' > input-upper
+  printf '\351\n' > input-lower
+  printf '\311\n' > input-upper
 
   # Check the output when all input characters are already the correct case.
   dd if=input-lower of=output-lower conv=lcase || fail=1
diff --git a/tests/ls/hyperlink.sh b/tests/ls/hyperlink.sh
index 7c4abd511..a6116ded5 100755
--- a/tests/ls/hyperlink.sh
+++ b/tests/ls/hyperlink.sh
@@ -45,7 +45,7 @@ mkdir testdir || framework_failure_
 cd testdir
 ls_encoded "testdir" > ../exp.t || framework_failure_
 for f in 'an#chor' 'back\slash' 'col:on' 'encoded%3Fquestion' \
-         "$(printf 'invalidutf8\xe9')" 'ques?tion' 'sp ace' 'utf8á'; do
+         "$(printf 'invalidutf8\351')" 'ques?tion' 'sp ace' 'utf8á'; do
   touch "$f" || framework_failure_
   ls_encoded "$f" >> ../exp.t || framework_failure_
 done
diff --git a/tests/sort/sort-locale.sh b/tests/sort/sort-locale.sh
index 4f18e3e28..b1cdbb8e4 100755
--- a/tests/sort/sort-locale.sh
+++ b/tests/sort/sort-locale.sh
@@ -39,7 +39,7 @@ export LC_ALL=en_US.iso8859-1  # only lowercase form works on macOS 10.15.7
 if test "$(locale charmap 2>/dev/null | sed 's/iso/ISO-/')" = ISO-8859-1; then
   check_hard_collate 'a_a' 'a b'  # underscore and space considered equal
   check_hard_collate 'aaa' 'BBB'  # case insensitive ordering
-  check_hard_collate "$(printf 'aa\xe9')" 'aaf'  # é comes before f
+  check_hard_collate "$(printf 'aa\351')" 'aaf'  # é comes before f
 fi
 
 export LC_ALL=$LOCALE_FR_UTF8
-- 
2.51.1

Reply via email to