diff --git a/Changelog b/Changelog index a16e3ee..77e1e34 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,9 @@ +2.46 + - fixed rt.cpan.org#56370: there was a sort() call in _store() + left, which lead to sorted arrays even if -SaveSorted were + turned off. + + 2.45 - fixed rt.cpan.org#50647 escaping bug. Now escaped $ or backslash characters are handled correctly (across save too) diff --git a/General.pm b/General.pm index 77f3fd1..3e7e732 100644 --- a/General.pm +++ b/General.pm @@ -32,7 +32,7 @@ use Carp::Heavy; use Carp; use Exporter; -$Config::General::VERSION = 2.45; +$Config::General::VERSION = 2.46; use vars qw(@ISA @EXPORT_OK); use base qw(Exporter); @@ -1201,7 +1201,7 @@ sub _store { foreach my $entry ( $this->{SaveSorted} ? sort keys %$config : keys %$config ) { if (ref($config->{$entry}) eq 'ARRAY') { - foreach my $line (sort @{$config->{$entry}}) { + foreach my $line ( $this->{SaveSorted} ? sort @{$config->{$entry}} : @{$config->{$entry}} ) { if (ref($line) eq 'HASH') { $config_string .= $this->_write_hash($level, $entry, $line); } @@ -2510,7 +2510,7 @@ Thomas Linden =head1 VERSION -2.45 +2.46 =cut diff --git a/t/cfg.8 b/t/cfg.8 index a826671..75b0d2f 100644 --- a/t/cfg.8 +++ b/t/cfg.8 @@ -8,8 +8,9 @@ age 31 +domain nix.to domain b0fh.org -domain b0fh.org +domain foo.bar message < 57; -use Test::More qw(no_plan); +use Test::More tests => 61; +#use Test::More qw(no_plan); # ahem, we deliver the test code with a local copy of # the Tie::IxHash module so we can do tests on sorted