]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: fix wildcard quoting in sc_tests_executable
authorPádraig Brady <P@draigBrady.com>
Fri, 20 Mar 2015 01:13:17 +0000 (01:13 +0000)
committerPádraig Brady <P@draigBrady.com>
Fri, 20 Mar 2015 01:16:06 +0000 (01:16 +0000)
* cfg.mk (sc_tests_executable): If there are files with
$TEST_EXTENSIONS in the current directory, then the
lack of quoting of the $test_extensions_rx contents
could result in globbing and an inconsequential run.
find(1) produces warnings only with more than one expansion.

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index d65af2726e6034a774893163ffcd38bea250bec6..a3b0e8e1d7c8fdd61bcebf50beab785c45e066f9 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -116,10 +116,9 @@ sc_tests_list_consistency:
 
 # Ensure that all version-controlled test scripts are executable.
 sc_tests_executable:
-       @test_extensions_rx=`echo $(TEST_EXTENSIONS)                    \
-         | sed -e "s/ / -o -name */g" -e "s/^/-name */"`; \
-       find tests/ \( $$test_extensions_rx \) \! -perm -u+x -print \
-         | sed -e "s/^/$(ME): Please make test executable: /" | grep . \
+       @test_extensions_rx=`printf -- "-name '*%s' " $(TEST_EXTENSIONS)`;\
+       find tests/ \( $$test_extensions_rx \) \! -perm -u+x -print       \
+         | sed -e "s/^/$(ME): Please make test executable: /" | grep .   \
            && exit 1; :
 
 # Ensure all gnulib patches apply cleanly