mirror of
https://codeberg.org/scip/Config-General.git
synced 2025-12-18 21:20:59 +01:00
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:
@@ -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
|
2.62 - fix rt.cpan.org#115326: Callback on 'pre_open' not called
|
||||||
when glob expands to one include file
|
when glob expands to one include file
|
||||||
|
|
||||||
|
|||||||
20
General.pm
20
General.pm
@@ -32,7 +32,7 @@ use Carp::Heavy;
|
|||||||
use Carp;
|
use Carp;
|
||||||
use Exporter;
|
use Exporter;
|
||||||
|
|
||||||
$Config::General::VERSION = "2.62";
|
$Config::General::VERSION = "2.63";
|
||||||
|
|
||||||
use vars qw(@ISA @EXPORT_OK);
|
use vars qw(@ISA @EXPORT_OK);
|
||||||
use base qw(Exporter);
|
use base qw(Exporter);
|
||||||
@@ -454,9 +454,18 @@ sub _open {
|
|||||||
$configfile = $basefile;
|
$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
|
# Something like: *.conf (or maybe dir/*.conf) was included; expand it and
|
||||||
# pass each expansion through this method again.
|
# pass each expansion through this method again.
|
||||||
|
local $_;
|
||||||
my @include = grep { -f $_ } bsd_glob($configfile, GLOB_BRACE | GLOB_QUOTE);
|
my @include = grep { -f $_ } bsd_glob($configfile, GLOB_BRACE | GLOB_QUOTE);
|
||||||
|
|
||||||
# applied patch by AlexK fixing rt.cpan.org#41030
|
# applied patch by AlexK fixing rt.cpan.org#41030
|
||||||
@@ -473,8 +482,9 @@ sub _open {
|
|||||||
# Multiple results or no expansion results (which is fine,
|
# Multiple results or no expansion results (which is fine,
|
||||||
# include foo/* shouldn't fail if there isn't anything matching)
|
# include foo/* shouldn't fail if there isn't anything matching)
|
||||||
# rt.cpan.org#79869: local $this->{IncludeGlob};
|
# rt.cpan.org#79869: local $this->{IncludeGlob};
|
||||||
for (@include) {
|
foreach my $file (@include) {
|
||||||
$this->_open($_);
|
print STDERR "CALLING __open($file)\n";
|
||||||
|
$this->_open($file);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2865,7 +2875,7 @@ Thomas Linden <tlinden |AT| cpan.org>
|
|||||||
|
|
||||||
=head1 VERSION
|
=head1 VERSION
|
||||||
|
|
||||||
2.62
|
2.63
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user