From b1ceac2ea6653b3eb999a383a38b9fcfd65344dc Mon Sep 17 00:00:00 2001 From: Elijah Perrault Date: Wed, 2 Feb 2011 12:45:48 -0700 Subject: [PATCH] Bug fix: Fixed broken no-parameter config blocks. --- doc/CHANGELOG | 1 + src/Parser/Config.pm | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index d2f2215..d78058a 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev ================================================================== + * Bug fix: Fixed broken no-parameter config blocks. * Added core command SHUTDOWN. * Added core command MODRELOAD. * Added core command MODUNLOAD. diff --git a/src/Parser/Config.pm b/src/Parser/Config.pm index 3cfee7d..0a9dcde 100644 --- a/src/Parser/Config.pm +++ b/src/Parser/Config.pm @@ -8,7 +8,6 @@ use strict; use warnings; # Create a new instance. -# Funny how we still haven't taken advantage of Mouse/Moose yet. sub new { my $class = shift; @@ -104,7 +103,6 @@ sub parse my @sblk = split('@@@', $blk); # Check to see if this config option already exists. - # Whose great idea was it to tab over this far? It screws with vim. :/ if (defined $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]}) { # It does, so merely push this second one to the existing array. push(@{ $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]} }, $param); @@ -116,12 +114,11 @@ sub parse } else { # We're inside a block with no parameter. - $rs{$blk}{$ebuf[0]} = $ebuf[1]; # Check to see if this config option already exists. if (defined $rs{$blk}{$ebuf[0]}) { # It does, so merely push this second one to the existing array. - push(@{ $rs{$blk}{$ebuf[0]} }, $param); + push(@{ $rs{$blk}{$ebuf[0]} }, $param); } else { # It doesn't, create it as an array. @@ -157,7 +154,7 @@ sub parse if (defined $ebuf[1]) { if ($ebuf[1] eq '{') { # This is the beginning of a block with no parameter. - $blk = $ebuf[0]; + $blk = $ebuf[0]; } elsif (defined $ebuf[2]) { if ($ebuf[2] eq '{') {