diff --git a/Changelog b/Changelog index 995b725..0369555 100644 --- a/Changelog +++ b/Changelog @@ -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 Config::General::Extended. diff --git a/General.pm b/General.pm index 2102022..d0af0b4 100644 --- a/General.pm +++ b/General.pm @@ -32,7 +32,7 @@ use Carp::Heavy; use Carp; use Exporter; -$Config::General::VERSION = "2.53"; +$Config::General::VERSION = "2.54"; use vars qw(@ISA @EXPORT_OK); use base qw(Exporter); @@ -632,12 +632,12 @@ sub _read { # Remove comments and empty lines s/(? .* bugfix rt.cpan.org#44600 next if /^\s*#/; - next if /^\s*$/; + #next if /^\s*$/; # look for multiline option, indicated by a trailing backslash if (/(? =head1 VERSION -2.53 +2.54 =cut diff --git a/README b/README index ea5354a..2a62d38 100644 --- a/README +++ b/README @@ -80,11 +80,11 @@ UPDATE COPYRIGHT Config::General Config::General::Extended - Copyright (c) 2000-2007 by Thomas Linden + Copyright (c) 2000-2014 by Thomas Linden Config::General::Interpolated Copyright (c) 2001 by Wei-Hon Chen - Copyright (c) 2002-2007 by Thomas Linden . + Copyright (c) 2002-2014 by Thomas Linden . This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. @@ -104,4 +104,4 @@ AUTHOR VERSION - 2.50 + 2.54 diff --git a/t/cfg.55 b/t/cfg.55 new file mode 100644 index 0000000..dab0a52 --- /dev/null +++ b/t/cfg.55 @@ -0,0 +1,5 @@ +a = 1 + +b = nochop\ + +c = should stay alone diff --git a/t/run.t b/t/run.t index 9609462..c504d6c 100644 --- a/t/run.t +++ b/t/run.t @@ -8,7 +8,7 @@ use Data::Dumper; -use Test::More tests => 70; +use Test::More tests => 71; #use Test::More qw(no_plan); # 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 %hash54 = $cfg54->getall(); 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");