This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
YA resync with mainstem, including VMS patches from others
[perl5.git] / ext / File / Glob / Glob.pm
index 98ee34d..57bfa0d 100644 (file)
@@ -138,6 +138,9 @@ sub csh_glob {
     $pat = $_ unless defined $pat;
 
     # extract patterns
+    $pat =~ s/^\s+//;  # Protect against empty elements in
+    $pat =~ s/\s+$//;  # things like < *.c> and <*.c >.
+                       # These alone shouldn't trigger ParseWords.
     if ($pat =~ /\s/) {
         # XXX this is needed for compatibility with the csh
        # implementation in Perl.  Need to support a flag