perl glob: make sure to put quotes around the pattern, in case of spaces
authorRichard Levitte <levitte@openssl.org>
Wed, 25 May 2016 13:02:20 +0000 (15:02 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 27 May 2016 15:41:32 +0000 (17:41 +0200)
RT#4486

Reviewed-by: Matt Caswell <matt@openssl.org>
test/recipes/80-test_ssl_new.t
test/run_tests.pl
util/process_docs.pl

index 5cafb9fdfdb238f15b3bc523f733b8db591fb7e2..07f1291f69ec219462c02b8c16de3ffca7453856 100644 (file)
@@ -20,7 +20,7 @@ setup("test_ssl_new");
 
 $ENV{TEST_CERTS_DIR} = srctop_dir("test", "certs");
 
-my @conf_srcs =  glob(srctop_file("test", "ssl-tests", "*.conf.in"));
+my @conf_srcs =  glob('"'.srctop_file("test", "ssl-tests", "*.conf.in").'"');
 map { s/;.*// } @conf_srcs if $^O eq "VMS";
 my @conf_files = map { basename($_) } @conf_srcs;
 map { s/\.in// } @conf_files;
index 158eaf9bab8348e9ff1b9b836a00044234b79f33..6ce1521a75829ded30bade3c3a33885455e8e69d 100644 (file)
@@ -42,13 +42,13 @@ my $list_mode = scalar(grep /^list$/, @tests) != 0;
 if (grep /^(alltests|list)$/, @tests) {
     @tests = grep {
        basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
-    } glob(catfile($recipesdir,"*.t"));
+    } glob('"'.catfile($recipesdir,"*.t").'"');
 } else {
     my @t = ();
     foreach (@tests) {
        push @t, grep {
            basename($_) =~ /^[0-9][0-9]-[^\.]*\.t$/
-       } glob(catfile($recipesdir,"*-$_.t"));
+       } glob('"'.catfile($recipesdir,"*-$_.t").'"');
     }
     @tests = @t;
 }
index c2c35ee1c5f7eb395ce39698e65217289a43d2e9..efc4ef53616197cbb5815f8d6536cdd032382b9d 100644 (file)
@@ -72,9 +72,9 @@ my $symlink_exists = eval { symlink("",""); 1 };
 foreach my $subdir (keys %{$options{subdir}}) {
     my $section = $options{subdir}->{$subdir};
     my $podsourcedir = catfile($options{sourcedir}, $subdir);
-    my $podglob = catfile($podsourcedir, "*.pod");
+    my $podglob = '"'.catfile($podsourcedir, "*.pod").'"';
 
-    foreach my $podfile (glob "$podglob") {
+    foreach my $podfile (glob $podglob) {
         my $podname = basename($podfile, ".pod");
         my $podpath = catfile($podfile);
         my %podinfo = ( section => $section );