util/copy.pl: work around glob quirk in some of earlier 5.1x Perl versions.
authorAndy Polyakov <appro@openssl.org>
Tue, 7 Nov 2017 20:38:30 +0000 (21:38 +0100)
committerAndy Polyakov <appro@openssl.org>
Wed, 8 Nov 2017 21:01:19 +0000 (22:01 +0100)
In earlier 5.1x Perl versions quoting globs works only if there is
white space. If there is none, it's looking for names starting with ".

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/4696)

util/copy-if-different.pl
util/copy.pl

index e1245f54aff120d68956208eb9d772434060a87b..5420f3f2bd30413ba6cb08d612635c82979ee243 100644 (file)
@@ -12,7 +12,8 @@ my @filelist;
 
 foreach my $arg (@ARGV) {
        $arg =~ s|\\|/|g;       # compensate for bug/feature in cygwin glob...
-       foreach (glob qq("$arg"))
+       $arg = qq("$arg") if ($arg =~ /\s/);    # compensate for bug in 5.10...
+       foreach (glob $arg)
                {
                push @filelist, $_;
                }
index a6b2a54ec6f06a2e4d7954f992f04e7fe8f032ee..9c0e68c41467ab1aa51008e1cb3175887254b7ab 100644 (file)
@@ -19,7 +19,8 @@ foreach $arg (@ARGV) {
                next;
                }
        $arg =~ s|\\|/|g;       # compensate for bug/feature in cygwin glob...
-       foreach (glob qq("$arg"))
+       $arg = qq("$arg") if ($arg =~ /\s/);    # compensate for bug in 5.10...
+       foreach (glob $arg)
                {
                push @filelist, $_;
                }