summaryrefslogtreecommitdiff
path: root/tests/init.sh
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-09-18 08:33:23 +0200
committerJim Meyering <meyering@redhat.com>2010-09-18 08:48:01 +0200
commitded759c27923c3173ca8dc8c5390f7246a2cc8ba (patch)
tree8df74908f1dd3ebf8dc95adc68dd164c8af738bf /tests/init.sh
parent6c2dd0147534160fc254ebefd5ab9feeeb95281b (diff)
downloadgnulib-ded759c27923c3173ca8dc8c5390f7246a2cc8ba.tar.gz
init.sh: don't let an ephemeral "*.exe" make us skip all dir entries
Not that it's likely to happen, but if I were to remove from a PATH directory a file named "*.exe" (yes, starting with an asterisk), at just the right moment, it would have made init.sh ignore all remaining .exe-suffixed names in that directory. * tests/init.sh (find_exe_basenames_): Don't give up on a directory if a file named "*.exe" is removed between the glob expansion and the processing of that oddly named file.
Diffstat (limited to 'tests/init.sh')
-rw-r--r--tests/init.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests/init.sh b/tests/init.sh
index d655fbbb60..20357ce9c2 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -240,9 +240,11 @@ find_exe_basenames_()
feb_result_=
feb_sp_=
for feb_file_ in $feb_dir_/*.exe; do
- if test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_"; then
- return 0
- fi
+ # If there was no *.exe file, or there existed a file named "*.exe" that
+ # was deleted between the above glob expansion and the existence test
+ # below, just skip it.
+ test "x$feb_file_" = "x$feb_dir_/*.exe" && test ! -f "$feb_file_" \
+ && continue
case $feb_file_ in
*[!-a-zA-Z/0-9_.+]*) feb_fail_=1; break;;
*) # Remove leading file name components as well as the .exe suffix.