From 00893e79fc62966067af1a106567db96bd170338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 3 Mar 2024 19:11:32 +0100 Subject: New upstream version 1.2 --- tests/init.sh | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'tests/init.sh') diff --git a/tests/init.sh b/tests/init.sh index d5d37c98..c5ec5cfd 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -1,6 +1,6 @@ # source this file; set up for tests -# Copyright (C) 2009-2022 Free Software Foundation, Inc. +# Copyright (C) 2009-2024 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -434,15 +434,15 @@ setup_ () # Remove relative and non-accessible directories from PATH, including '.' # and Zero-length entries. - saved_IFS="$IFS" - IFS=: + saved_IFS="$IFS"; IFS="$PATH_SEPARATOR" new_PATH= - sep_= for dir in $PATH; do + IFS="$saved_IFS" case "$dir" in - /*) test -d "$dir/." || continue - new_PATH="${new_PATH}${sep_}${dir}" - sep_=':';; + [\\/]* | ?:[\\/]*) + test -d "$dir/." || continue + new_PATH="${new_PATH}${new_PATH:+$PATH_SEPARATOR}${dir}" + ;; esac done IFS="$saved_IFS" @@ -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 -- cgit v1.2.3