[mm-common] Treat whitespace in glob patterns literally



commit 8fadd65f0cd623347b3f08009f8c5d716b63908a
Author: Daniel Elstner <danielk openismus com>
Date:   Fri Sep 11 19:02:02 2009 +0200

    Treat whitespace in glob patterns literally
    
    * util/doc-{install,postprocess}.pl: Explicitly call the bsd_glob()
    subroutine instead of the builtin glob() function.  Although the
    builtin glob() is implemented in terms of bsd_glob(), it additionally
    splits its argument into multiple patterns separated by whitespace.

 util/doc-install.pl     |    3 ++-
 util/doc-postprocess.pl |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/util/doc-install.pl b/util/doc-install.pl
index aeab988..91d3bdc 100644
--- a/util/doc-install.pl
+++ b/util/doc-install.pl
@@ -20,6 +20,7 @@ package main;
 use strict;
 use warnings;
 use bytes;
+use File::Glob qw(:glob);
 use File::Spec;
 use Getopt::Long qw(:config no_getopt_compat no_ignore_case require_order bundling);
 
@@ -201,7 +202,7 @@ unless (defined $target_dir)
 }
 error('No target directory specified') unless (defined($target_dir) and $target_dir ne '');
 
- ARGV = map(glob, @ARGV) if ($expand_glob);
+ ARGV = map(bsd_glob($_, GLOB_NOSORT), @ARGV) if ($expand_glob);
 my %basename_hash = ();
 
 foreach my $in_name (@ARGV)
diff --git a/util/doc-postprocess.pl b/util/doc-postprocess.pl
index 5af4ef0..2fbea7c 100644
--- a/util/doc-postprocess.pl
+++ b/util/doc-postprocess.pl
@@ -20,6 +20,7 @@ package main;
 use strict;
 use warnings;
 use bytes;
+use File::Glob qw(:glob);
 use File::Spec;
 use Getopt::Long qw(:config no_getopt_compat no_ignore_case require_order bundling);
 
@@ -58,7 +59,7 @@ sub error (@)
 GetOptions('help|?' => \&exit_help)
   or exit 2;
 
-foreach my $filename (map(glob, @ARGV))
+foreach my $filename (map(bsd_glob($_, GLOB_NOSORT), @ARGV))
 {
   my @buf;
   my $file;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]