From dabf2c747d60fcbb17bc83d947e50425a0b46ea7 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 3 Jan 2022 11:45:37 -0800 Subject: build: update gnulib to latest; also bootstrap and init.sh --- tests/init.sh | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'tests') 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 -- cgit v1.2.1