From 0201866781023c56e2bf66dbe41f873ef2653eb4 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 7 Nov 2026 12:01:13 +0100 Subject: [PATCH] tests: printf: ensure %q quotes C1 controls in names with apostrophes Reported at https://github.com/uutils/coreutils/issues/15810 * tests/printf/printf-quote.sh: Add a test case. Link: https://github.com/coreutils/coreutils/pull/445 --- tests/printf/printf-quote.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/printf/printf-quote.sh b/tests/printf/printf-quote.sh index 9eb710430..9c14f44b7 100755 --- a/tests/printf/printf-quote.sh +++ b/tests/printf/printf-quote.sh @@ -44,12 +44,15 @@ if test -n "$LOCALE_FR_UTF8" && test "$LOCALE_FR_UTF8" != "none"; then LC_ALL=$f $prog '%q\n' 'áḃç' > out #non-printable multi-byte LC_ALL=$f $prog '%q\n' "$($prog '\xc2\x81')" >> out + #non-printable multi-byte in a name with an apostrophe + LC_ALL=$f $prog '%q\n' "$($prog "it's\\xc2\\x9bhere")" >> out #printable multi-byte in C locale LC_ALL=C $prog '%q\n' 'áḃç' >> out ) cat <<\EOF > exp || framework_failure_ áḃç ''$'\302\201' +'it'\''s'$'\302\233''here' ''$'\303\241\341\270\203\303\247' EOF compare exp out || fail=1