diff options
author | Jim Meyering <meyering@fb.com> | 2022-01-01 10:23:53 -0800 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2022-01-01 10:26:11 -0800 |
commit | 1843c0b0c88520feff81897d96037e2d69e15d92 (patch) | |
tree | 3e144ab33d144023bb76a71437b92b55899f0a59 /tests | |
parent | d30721074f25885a85052a6b4704fce10e2e93a8 (diff) | |
download | grep-1843c0b0c88520feff81897d96037e2d69e15d92.tar.gz |
build: update gnulib to latest; also bootstrap and init.sh
Diffstat (limited to 'tests')
-rw-r--r-- | tests/init.sh | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/init.sh b/tests/init.sh index 9ef83488..933fdd40 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 |