summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2023-01-14 16:56:26 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2023-01-15 16:38:56 -0800
commit72ccd15d5c73c687dc7eef81f3dbea2f33134cc4 (patch)
tree39f8fea65d26b084cea0685f94931335ad4cf728
parenteae77386eb4425ed096a168b909220ea8b27657a (diff)
downloadgrep-72ccd15d5c73c687dc7eef81f3dbea2f33134cc4.tar.gz
tests: update tests/init.sh
* tests/init.sh: Update from Gnulib.
-rw-r--r--tests/init.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/init.sh b/tests/init.sh
index a502b4f6..0494097e 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -646,18 +646,19 @@ compare_dev_null_ ()
for diff_opt_ in -u -U3 -c '' no; do
test "$diff_opt_" != no &&
- diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" < /dev/null` &&
+ diff_out_=`exec 2>/dev/null
+ LC_ALL=C diff $diff_opt_ "$0" "$0" < /dev/null` &&
break
done
if test "$diff_opt_" != no; then
if test -z "$diff_out_"; then
- compare_ () { diff $diff_opt_ "$@"; }
+ compare_ () { LC_ALL=C diff $diff_opt_ "$@"; }
else
compare_ ()
{
# If no differences were found, AIX and HP-UX 'diff' produce output
# like "No differences encountered". Hide this output.
- diff $diff_opt_ "$@" > diff.out
+ LC_ALL=C diff $diff_opt_ "$@" > diff.out
diff_status_=$?
test $diff_status_ -eq 0 || cat diff.out || diff_status_=2
rm -f diff.out || diff_status_=2
@@ -702,4 +703,4 @@ test -f "$srcdir/init.cfg" \
setup_ "$@"
# This trap is here, rather than in the setup_ function, because some
# shells run the exit trap at shell function exit, rather than script exit.
-trap remove_tmp_ 0
+trap remove_tmp_ EXIT