fix rt.cpan.org #116340: support includes with globs on win32 platforms

git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@112 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
Thomas von Dein
2016-07-29 06:09:04 +00:00
parent a49de35c81
commit bb38955968
3 changed files with 21 additions and 6 deletions

View File

@@ -1,3 +1,8 @@
2.63 - fix for rt.cpan.org#116340: do only consider a backslash
as meta escape char, but not if it appears on it's own,
as it happens on windows platforms. Thanks to for finding
and tracking it down.
2.62 - fix rt.cpan.org#115326: Callback on 'pre_open' not called
when glob expands to one include file

View File

@@ -32,7 +32,7 @@ use Carp::Heavy;
use Carp;
use Exporter;
$Config::General::VERSION = "2.62";
$Config::General::VERSION = "2.63";
use vars qw(@ISA @EXPORT_OK);
use base qw(Exporter);
@@ -454,9 +454,18 @@ sub _open {
$configfile = $basefile;
}
if ($this->{IncludeGlob} and $configfile =~ /[*?\[\{\\]/) {
my $glob = qr/[*?\[\{\\]/;
if ($^O =~ /win/i) {
# fix for rt.cpan.org#116340: do only consider a backslash
# as meta escape char, but not if it appears on it's own,
# as it happens on windows platforms.
$glob = qr/(\\[*?\[\{\\]|[*?\[\{])/;
}
if ($this->{IncludeGlob} and $configfile =~ /$glob/) {
# Something like: *.conf (or maybe dir/*.conf) was included; expand it and
# pass each expansion through this method again.
local $_;
my @include = grep { -f $_ } bsd_glob($configfile, GLOB_BRACE | GLOB_QUOTE);
# applied patch by AlexK fixing rt.cpan.org#41030
@@ -473,8 +482,9 @@ sub _open {
# Multiple results or no expansion results (which is fine,
# include foo/* shouldn't fail if there isn't anything matching)
# rt.cpan.org#79869: local $this->{IncludeGlob};
for (@include) {
$this->_open($_);
foreach my $file (@include) {
print STDERR "CALLING __open($file)\n";
$this->_open($file);
}
return;
}
@@ -2865,7 +2875,7 @@ Thomas Linden <tlinden |AT| cpan.org>
=head1 VERSION
2.62
2.63
=cut

2
README
View File

@@ -104,4 +104,4 @@ AUTHOR
VERSION
2.62
2.63