]> Savannah Git Hosting - gnulib.git/commitdiff
test-framework-sh: Avoid /bin/sh on AIX 7.2 due to its printf built-in.
authorBruno Haible <bruno@clisp.org>
Thu, 26 Dec 2019 11:29:20 +0000 (12:29 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 26 Dec 2019 23:18:17 +0000 (00:18 +0100)
Reported by Paul Eggert in
<https://lists.gnu.org/archive/html/grep-devel/2019-12/msg00020.html>.
Simplification by Jim Meyering.

* tests/init.sh (gl_shell_test_script_): Add a test of printf of an
octal escape sequence in a UTF-8 locale.

ChangeLog
tests/init.sh

index 70b46625fa71fda3aa5bd47d12d5d880eadd48a1..5161363599272a32f1e7eb3e008c2359cd0db6b9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2019-12-26  Bruno Haible  <bruno@clisp.org>
+
+       test-framework-sh: Avoid /bin/sh on AIX 7.2 due to its printf built-in.
+       Reported by Paul Eggert in
+       <https://lists.gnu.org/archive/html/grep-devel/2019-12/msg00020.html>.
+       Simplification by Jim Meyering.
+       * tests/init.sh (gl_shell_test_script_): Add a test of printf of an
+       octal escape sequence in a UTF-8 locale.
+
 2019-12-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        mbrtowc: port better to narrow-wchar_t platforms
index 8ca5c90551c7763dc6e1546d593cb4ca28faf70f..049e0d359c5ffbd13606af5e831f73827e693945 100644 (file)
@@ -129,6 +129,8 @@ else
 fi
 
 # We require $(...) support unconditionally.
+# We require that the printf built-in work correctly regarding octal escapes;
+# this eliminates /bin/sh on AIX 7.2.
 # We require non-surprising "local" semantics (this eliminates dash).
 # This takes the admittedly draconian step of eliminating dash, because the
 # assignment tab=$(printf '\t') works fine, yet preceding it with "local "
@@ -158,6 +160,12 @@ fi
 #  ? - not ok
 gl_shell_test_script_='
 test $(echo y) = y || exit 1
+LC_ALL=en_US.UTF-8 printf "\\351" 2>/dev/null \
+  | LC_ALL=C tr "\\351" x | LC_ALL=C grep x > /dev/null \
+  || exit 1
+printf "\\351" 2>/dev/null \
+  | LC_ALL=C tr "\\351" x | LC_ALL=C grep x > /dev/null \
+  || exit 1
 f_local_() { local v=1; }; f_local_ || exit 1
 f_dash_local_fail_() { local t=$(printf " 1"); }; f_dash_local_fail_
 score_=10