fix rt.cpan.org#113671

git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@108 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
Thomas von Dein
2016-04-12 07:19:40 +00:00
parent 1875861621
commit 16947651e5
2 changed files with 331 additions and 328 deletions

View File

@@ -1,3 +1,5 @@
next - fix rt.cpan.org#113671: ignore utf BOM, if any.
2.60 - fix rt.cpan.org#107929: added missing test config. 2.60 - fix rt.cpan.org#107929: added missing test config.
2.59 - fix rt.cpan.org#107108 by adding support for IncludeOptional. 2.59 - fix rt.cpan.org#107108 by adding support for IncludeOptional.

View File

@@ -5,7 +5,7 @@
# config values from a given file and # config values from a given file and
# return it as hash structure # return it as hash structure
# #
# Copyright (c) 2000-2015 Thomas Linden <tlinden |AT| cpan.org>. # Copyright (c) 2000-2016 Thomas Linden <tlinden |AT| cpan.org>.
# All Rights Reserved. Std. disclaimer applies. # All Rights Reserved. Std. disclaimer applies.
# Artistic License, same as perl itself. Have fun. # Artistic License, same as perl itself. Have fun.
# #
@@ -32,7 +32,7 @@ use Carp::Heavy;
use Carp; use Carp;
use Exporter; use Exporter;
$Config::General::VERSION = "2.60"; $Config::General::VERSION = "2.61";
use vars qw(@ISA @EXPORT_OK); use vars qw(@ISA @EXPORT_OK);
use base qw(Exporter); use base qw(Exporter);
@@ -795,11 +795,12 @@ sub _parse {
$chunk++; $chunk++;
$_ =~ s/^\s+//; # strip spaces @ end and begin $_ =~ s/^\s+//; # strip spaces @ end and begin
$_ =~ s/\s+$//; $_ =~ s/\s+$//;
$_ =~ s/^\x{ef}\x{bb}\x{bf}//; # strip utf BOM, if any, fix rt.cpan.org#113671
# #
# build option value assignment, split current input # build option value assignment, split current input
# using whitespace, equal sign or optionally here-doc # using whitespace, equal sign or optionally here-doc
# separator EOFseparator # separator EOFseparator
my ($option,$value); my ($option,$value);
if (/$this->{EOFseparator}/) { if (/$this->{EOFseparator}/) {
($option,$value) = split /\s*$this->{EOFseparator}\s*/, $_, 2; # separated by heredoc-finding in _open() ($option,$value) = split /\s*$this->{EOFseparator}\s*/, $_, 2; # separated by heredoc-finding in _open()
@@ -828,7 +829,7 @@ sub _parse {
if (/^<([^\/]+?.*?)>$/) { # look if it is a block if (/^<([^\/]+?.*?)>$/) { # look if it is a block
$block = $1; # store block name $block = $1; # store block name
if ($block =~ /^"([^"]+)"$/) { if ($block =~ /^"([^"]+)"$/) {
# quoted block, unquote it and do not split # quoted block, unquote it and do not split
$block =~ s/"//g; $block =~ s/"//g;
} }
else { else {
@@ -2774,7 +2775,7 @@ Thomas Linden <tlinden |AT| cpan.org>
=head1 VERSION =head1 VERSION
2.60 2.61
=cut =cut