* tests/sort/sort-locale.sh: Avoid non portable printf \u....
* cfg.mk (sc_env_printf): Add a new syntax check to flag future cases.
---
 cfg.mk                    | 6 ++++++
 tests/sort/sort-locale.sh | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/cfg.mk b/cfg.mk
index e0d90cf83..393b6bbb1 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -642,6 +642,12 @@ sc_env_test_dependencies:
                || echo $$test should call: print_ver_ $$prog; \
            done | grep . && exit 1 || :
 
+# Enforce using our printf if using \u or \x
+sc_env_printf:
+       @cd $(top_srcdir) && GIT_PAGER= git grep 'printf.*[^\\]\\[ux]' tests \
+         | grep -v -- '--printf' | grep -v 'env printf' \
+         && { echo 'use "env printf" with \x or \u'; exit 1; } || :
+
 # Use framework_failure_, not the old name without the trailing underscore.
 sc_prohibit_framework_failure:
        @prohibit='$(begword)framework_''failure$(endword)'             \
diff --git a/tests/sort/sort-locale.sh b/tests/sort/sort-locale.sh
index b1cdbb8e4..5339bd830 100755
--- a/tests/sort/sort-locale.sh
+++ b/tests/sort/sort-locale.sh
@@ -45,7 +45,7 @@ fi
 export LC_ALL=$LOCALE_FR_UTF8
 if test "$(locale charmap 2>/dev/null)" = UTF-8; then
   check_hard_collate 'aaé' 'aaf'  # é comes before f
-  check_hard_collate 'aéY' "$(printf 'ae\u0301Z')"  # NFC/NFD é are equal
+  check_hard_collate 'aéY' "$(printf 'ae\314\201Z')"  # NFC/NFD é are equal
 fi
 
 Exit $fail
-- 
2.51.1


Reply via email to