2.14 - fixed bug reported by Francisco Olarte Sanz

<folarte@peoplecall.com>, which caused _parse to
	   ignore blocks with the name "0": 
	   <0> .. </0>, because it checked just if $block (the name
	   between < and >) is true, and from the perl point
	   of view "0" is not. Changed it to check for defined.
	   Normally I avoid using 'defined' but in this case
	   it will not be possible that $block contains the
	   empty string, so defined is ok here.


git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@40 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
Thomas von Dein
2009-10-10 16:26:19 +00:00
parent 60f71c637c
commit cc6bb346f7
5 changed files with 43 additions and 30 deletions

View File

@@ -17,7 +17,7 @@ use strict;
use Carp;
use Exporter;
$Config::General::VERSION = "2.13";
$Config::General::VERSION = "2.14";
use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter);
@@ -491,7 +491,7 @@ sub _parse {
$value =~ s/^"//; # remove leading and trailing "
$value =~ s/"$//;
}
if (!$block) { # not inside a block @ the moment
if (! defined $block) { # not inside a block @ the moment
if (/^<([^\/]+?.*?)>$/) { # look if it is a block
$this->{level} += 1;
$block = $1; # store block name
@@ -1788,7 +1788,7 @@ Thomas Linden <tom@daemon.de>
=head1 VERSION
2.13
2.14
=cut