From 95dea21fcaa62d8d5efb2afe9d7c1afcd5ec496f Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Fri, 7 Nov 2014 08:30:31 -0800
Subject: [PATCH 1/2] maint: move helper function, hex_printf to init.cfg

* tests/init.cfg (hex_printf_): New function, from ...
* tests/multibyte-white-space: ... here.  Reflect the
s/hex_print/hex_printf_/ renaming.
---
 tests/init.cfg              |  8 ++++++++
 tests/multibyte-white-space | 12 ++----------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/init.cfg b/tests/init.cfg
index 882feb1..9342d3d 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -154,3 +154,11 @@ or use the shortcut target of the toplevel Makefile,
 '
   fi
 }
+
+# Like printf with a single argument.
+# The difference is that while some printf implementations fail to
+# handle \xHH escapes, no awk implementation has that problem.
+hex_printf_()
+{
+   ${AWK-awk} 'BEGIN { printf "'"$1"'" }' </dev/null
+}
diff --git a/tests/multibyte-white-space b/tests/multibyte-white-space
index 5816643..bb1bdaf 100755
--- a/tests/multibyte-white-space
+++ b/tests/multibyte-white-space
@@ -57,18 +57,10 @@ EOF

 fail=0

-# Like printf with a single argument.
-# The difference is that while some printf implementations fail to
-# handle \xHH escapes, no awk implementation has that problem.
-hex_printf()
-{
-   ${AWK-awk} 'BEGIN { printf "'"$1"'" }' </dev/null
-}
-
 for i in $utf8_space_characters; do
-  hex_printf "$i\n" | grep -q '^\s$' \
+  hex_printf_ "$i\n" | grep -q '^\s$' \
       || { warn_ "$i FAILED to match \\s"; fail=1; }
-  hex_printf "$i\n" | grep -q '\S'
+  hex_printf_ "$i\n" | grep -q '\S'
   test $? = 1 \
       || { warn_ "$i vs. \\S FAILED"; fail=1; }
 done
-- 
2.1.2

