mirror of
https://codeberg.org/scip/Config-General.git
synced 2025-12-17 20:51:00 +01:00
1.23: - fixed bug, which removed trailing or leading " even
no matching " was there. git-svn-id: http://dev.catalyst.perl.org/repos/Config-General/trunk@11 be1acefe-a474-0410-9a34-9b3221f2030f
This commit is contained in:
18
General.pm
18
General.pm
@@ -10,15 +10,17 @@
|
|||||||
# All Rights Reserved. Std. disclaimer applies.
|
# All Rights Reserved. Std. disclaimer applies.
|
||||||
# Artificial License, same as perl itself. Have fun.
|
# Artificial License, same as perl itself. Have fun.
|
||||||
#
|
#
|
||||||
# Changes from 1.21: - added a new option to new(): -LowerCaseNames, which
|
# 1.23: - fixed bug, which removed trailing or leading " even
|
||||||
|
# no matching " was there.
|
||||||
|
# 1.22: - added a new option to new(): -LowerCaseNames, which
|
||||||
# lowercases all option-names (feature request)
|
# lowercases all option-names (feature request)
|
||||||
# Changes from 1.20: - lines with just one "#" became an option array named
|
# 1.21: - lines with just one "#" became an option array named
|
||||||
# "#" with empty entries, very weird, fixed
|
# "#" with empty entries, very weird, fixed
|
||||||
# Changes from 1.19: - added an if(exists... to new() for checking of the
|
# 1.20: - added an if(exists... to new() for checking of the
|
||||||
# existence of -AllowMultiOptions.
|
# existence of -AllowMultiOptions.
|
||||||
# - use now "local $_" because it caused weird results
|
# - use now "local $_" because it caused weird results
|
||||||
# if a user used $_ with the module.
|
# if a user used $_ with the module.
|
||||||
# Changes from 1.18: - you can escape "#" characters using a backslash: "\#"
|
# 1.19: - you can escape "#" characters using a backslash: "\#"
|
||||||
# which will now no more treated as a comment.
|
# which will now no more treated as a comment.
|
||||||
# - comments inside here-documents will now remain in the
|
# - comments inside here-documents will now remain in the
|
||||||
# here-doc value.
|
# here-doc value.
|
||||||
@@ -30,7 +32,7 @@ use FileHandle;
|
|||||||
use strict;
|
use strict;
|
||||||
use Carp;
|
use Carp;
|
||||||
|
|
||||||
$Config::General::VERSION = "1.22";
|
$Config::General::VERSION = "1.23";
|
||||||
|
|
||||||
sub new {
|
sub new {
|
||||||
#
|
#
|
||||||
@@ -209,8 +211,10 @@ sub _parse {
|
|||||||
my ($option,$value) = split /\s*=\s*|\s+/, $_, 2; # option/value assignment, = is optional
|
my ($option,$value) = split /\s*=\s*|\s+/, $_, 2; # option/value assignment, = is optional
|
||||||
my $indichar = chr(182); # <20>, inserted by _open, our here-doc indicator
|
my $indichar = chr(182); # <20>, inserted by _open, our here-doc indicator
|
||||||
$value =~ s/^$indichar// if($value); # a here-doc begin, remove indicator
|
$value =~ s/^$indichar// if($value); # a here-doc begin, remove indicator
|
||||||
$value =~ s/^"// if($value); # remove leading and trailing "
|
if ($value && $value =~ /^"/ && $value =~ /"$/) {
|
||||||
$value =~ s/"$// if($value);
|
$value =~ s/^"//; # remove leading and trailing "
|
||||||
|
$value =~ s/"$//;
|
||||||
|
}
|
||||||
if (!$block) { # not inside a block @ the moment
|
if (!$block) { # not inside a block @ the moment
|
||||||
if (/^<([^\/]+?.*?)>$/) { # look if it is a block
|
if (/^<([^\/]+?.*?)>$/) { # look if it is a block
|
||||||
$this->{level} += 1;
|
$this->{level} += 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user