mirror of
https://codeberg.org/scip/Config-General.git
synced 2025-12-16 20:21:01 +01:00
fixed rt.cpan.org#39814.
git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@99 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
2.54 - fixed rt.cpan.org#39814. changed the order of pre-processing
|
||||||
|
in _read(): 1) remove comments, 2) check for continuation,
|
||||||
|
3) remove empty lines.
|
||||||
|
|
||||||
2.53 - applied patch rt.cpan.org#68153, which adds a find() method to
|
2.53 - applied patch rt.cpan.org#68153, which adds a find() method to
|
||||||
Config::General::Extended.
|
Config::General::Extended.
|
||||||
|
|
||||||
|
|||||||
11
General.pm
11
General.pm
@@ -32,7 +32,7 @@ use Carp::Heavy;
|
|||||||
use Carp;
|
use Carp;
|
||||||
use Exporter;
|
use Exporter;
|
||||||
|
|
||||||
$Config::General::VERSION = "2.53";
|
$Config::General::VERSION = "2.54";
|
||||||
|
|
||||||
use vars qw(@ISA @EXPORT_OK);
|
use vars qw(@ISA @EXPORT_OK);
|
||||||
use base qw(Exporter);
|
use base qw(Exporter);
|
||||||
@@ -632,12 +632,12 @@ sub _read {
|
|||||||
# Remove comments and empty lines
|
# Remove comments and empty lines
|
||||||
s/(?<!\\)#.*$//; # .+ => .* bugfix rt.cpan.org#44600
|
s/(?<!\\)#.*$//; # .+ => .* bugfix rt.cpan.org#44600
|
||||||
next if /^\s*#/;
|
next if /^\s*#/;
|
||||||
next if /^\s*$/;
|
#next if /^\s*$/;
|
||||||
|
|
||||||
|
|
||||||
# look for multiline option, indicated by a trailing backslash
|
# look for multiline option, indicated by a trailing backslash
|
||||||
if (/(?<!\\)\\$/) {
|
if (/(?<!\\)\\$/) {
|
||||||
chop;
|
chop; # remove trailing backslash
|
||||||
s/^\s*//;
|
s/^\s*//;
|
||||||
$longline .= $_;
|
$longline .= $_;
|
||||||
next;
|
next;
|
||||||
@@ -706,6 +706,9 @@ sub _read {
|
|||||||
next;
|
next;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
# ignore empty lines
|
||||||
|
next if /^\s*$/;
|
||||||
|
|
||||||
# look for include statement(s)
|
# look for include statement(s)
|
||||||
my $incl_file;
|
my $incl_file;
|
||||||
my $path = '';
|
my $path = '';
|
||||||
@@ -2745,7 +2748,7 @@ Thomas Linden <tlinden |AT| cpan.org>
|
|||||||
|
|
||||||
=head1 VERSION
|
=head1 VERSION
|
||||||
|
|
||||||
2.53
|
2.54
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
|||||||
6
README
6
README
@@ -80,11 +80,11 @@ UPDATE
|
|||||||
COPYRIGHT
|
COPYRIGHT
|
||||||
Config::General
|
Config::General
|
||||||
Config::General::Extended
|
Config::General::Extended
|
||||||
Copyright (c) 2000-2007 by Thomas Linden <tom@daemon.de>
|
Copyright (c) 2000-2014 by Thomas Linden <tom@daemon.de>
|
||||||
|
|
||||||
Config::General::Interpolated
|
Config::General::Interpolated
|
||||||
Copyright (c) 2001 by Wei-Hon Chen <plasmaball@pchome.com.tw>
|
Copyright (c) 2001 by Wei-Hon Chen <plasmaball@pchome.com.tw>
|
||||||
Copyright (c) 2002-2007 by Thomas Linden <tom@daemon.de>.
|
Copyright (c) 2002-2014 by Thomas Linden <tom@daemon.de>.
|
||||||
|
|
||||||
This library is free software; you can redistribute it
|
This library is free software; you can redistribute it
|
||||||
and/or modify it under the same terms as Perl itself.
|
and/or modify it under the same terms as Perl itself.
|
||||||
@@ -104,4 +104,4 @@ AUTHOR
|
|||||||
|
|
||||||
|
|
||||||
VERSION
|
VERSION
|
||||||
2.50
|
2.54
|
||||||
|
|||||||
7
t/run.t
7
t/run.t
@@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
|
|
||||||
use Data::Dumper;
|
use Data::Dumper;
|
||||||
use Test::More tests => 70;
|
use Test::More tests => 71;
|
||||||
#use Test::More qw(no_plan);
|
#use Test::More qw(no_plan);
|
||||||
|
|
||||||
# ahem, we deliver the test code with a local copy of
|
# ahem, we deliver the test code with a local copy of
|
||||||
@@ -737,3 +737,8 @@ ok( !@WARNINGS_FOUND, "No unexpected warnings seen" );
|
|||||||
my $cfg54 = new Config::General(-NoEscape => 1, -String => qq(val = \\\$notavar:\\blah\n));
|
my $cfg54 = new Config::General(-NoEscape => 1, -String => qq(val = \\\$notavar:\\blah\n));
|
||||||
my %hash54 = $cfg54->getall();
|
my %hash54 = $cfg54->getall();
|
||||||
is($hash54{val}, qq(\\\$notavar:\\blah), "check -NoEscape");
|
is($hash54{val}, qq(\\\$notavar:\\blah), "check -NoEscape");
|
||||||
|
|
||||||
|
# check for line continuation followed by empty line (rt.cpan.org#39814)
|
||||||
|
my $cfg55 = new Config::General( -ConfigFile => "t/cfg.55" );
|
||||||
|
my %hash55 = $cfg55->getall();
|
||||||
|
is($hash55{b}, "nochop", "check continuation followed by empty line");
|
||||||
|
|||||||
Reference in New Issue
Block a user