[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
grep branch, master, updated. v2.20-78-g7c476ca
From: |
Jim Meyering |
Subject: |
grep branch, master, updated. v2.20-78-g7c476ca |
Date: |
Sun, 09 Nov 2014 01:04:47 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grep".
The branch, master has been updated
via 7c476caba56c5d25ac0426d2092b3d00af43913e (commit)
from 8435da9d8106513acd5c87b74f8a928073f2cd5d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/grep.git/commit/?id=7c476caba56c5d25ac0426d2092b3d00af43913e
commit 7c476caba56c5d25ac0426d2092b3d00af43913e
Author: Norihiro Tanaka <address@hidden>
Date: Sat Nov 8 07:49:27 2014 -0800
tests: avoid awk+printf+\xHH portability trap
* tests/init.cfg (hex_printf_): Rewrite in terms of printf and sed.
Using awk's printf with \xHH in the format string was not portable
to the awk of Solaris 10, AIX 7 or HP-UX 11.23, as reported in
http://debbugs.gnu.org/18987.
* tests/word-multibyte: Use printf rather than hex_printf_,
and give the character we're printing a name: e_acute (rather
than A-grave), since that is used in other tests.
a trailing \n in the format string, adjust by removing it, and
instead invoking echo.
* tests/multibyte-white-space: Simply remove each trailing \n.
They were not needed.
diff --git a/tests/init.cfg b/tests/init.cfg
index 9342d3d..1fb25f5 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -155,10 +155,10 @@ 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.
+# Like printf with a single argument, but that argument must be a
+# sequence of four-byte strings \xHH where each H is a hexadecimal byte.
hex_printf_()
{
- ${AWK-awk} 'BEGIN { printf "'"$1"'" }' </dev/null
+ printf $(printf '\\%o' \
+ $(printf %s "$1"|sed 's,\\x\([0-9a-fA-f][0-9a-fA-f]\), 0x\1,g'))
}
diff --git a/tests/multibyte-white-space b/tests/multibyte-white-space
index bb1bdaf..abd4dc5 100755
--- a/tests/multibyte-white-space
+++ b/tests/multibyte-white-space
@@ -58,9 +58,9 @@ EOF
fail=0
for i in $utf8_space_characters; do
- hex_printf_ "$i\n" | grep -q '^\s$' \
+ hex_printf_ "$i" | grep -q '^\s$' \
|| { warn_ "$i FAILED to match \\s"; fail=1; }
- hex_printf_ "$i\n" | grep -q '\S'
+ hex_printf_ "$i" | grep -q '\S'
test $? = 1 \
|| { warn_ "$i vs. \\S FAILED"; fail=1; }
done
diff --git a/tests/word-multibyte b/tests/word-multibyte
index f2caf97..ba37b85 100755
--- a/tests/word-multibyte
+++ b/tests/word-multibyte
@@ -4,7 +4,8 @@
require_en_utf8_locale_
-hex_printf_ '\xc3\xa1\n' > in || framework_failure_
+e_acute=$(printf '\303\251')
+printf "$e_acute\n" > in || framework_failure_
LC_ALL=en_US.UTF-8
export LC_ALL
-----------------------------------------------------------------------
Summary of changes:
tests/init.cfg | 8 ++++----
tests/multibyte-white-space | 4 ++--
tests/word-multibyte | 3 ++-
3 files changed, 8 insertions(+), 7 deletions(-)
hooks/post-receive
--
grep
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- grep branch, master, updated. v2.20-78-g7c476ca,
Jim Meyering <=