summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2022-01-03 11:45:37 -0800
committerJim Meyering <meyering@fb.com>2022-01-03 11:45:59 -0800
commitdabf2c747d60fcbb17bc83d947e50425a0b46ea7 (patch)
tree2444efe0d3de8f498ee9125a37d4534fadeb86c0 /tests
parent5a4339a609e606562c198ac35ff557958cab1ffc (diff)
downloaddiffutils-dabf2c747d60fcbb17bc83d947e50425a0b46ea7.tar.gz
build: update gnulib to latest; also bootstrap and init.sh
Diffstat (limited to 'tests')
-rw-r--r--tests/init.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/init.sh b/tests/init.sh
index 9ef8348..933fdd4 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -1,6 +1,6 @@
# source this file; set up for tests
-# Copyright (C) 2009-2021 Free Software Foundation, Inc.
+# Copyright (C) 2009-2022 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
@@ -426,6 +426,23 @@ setup_ ()
for sig_ in 1 2 3 13 15; do
eval "trap 'Exit $(expr $sig_ + 128)' $sig_"
done
+
+ # Remove relative and non-accessible directories from PATH, including '.'
+ # and Zero-length entries.
+ saved_IFS="$IFS"
+ IFS=:
+ new_PATH=
+ sep_=
+ for dir in $PATH; do
+ case "$dir" in
+ /*) test -d "$dir/." || continue
+ new_PATH="${new_PATH}${sep_}${dir}"
+ sep_=':';;
+ esac
+ done
+ IFS="$saved_IFS"
+ PATH="$new_PATH"
+ export PATH
}
# This is a stub function that is run upon trap (upon regular exit and