Bug fix: Fixed broken no-parameter config blocks.
This commit is contained in:
1 parent
5f0451dc1e
commit
b1ceac2ea6
2 files changed
+3
-5
No files matched your search
@@ -3,6 +3,7 @@ Auto IRC Bot 3.0: Change Log
|
|||||||
|
|
||||||
3.0 Indev
|
3.0 Indev
|
||||||
==================================================================
|
==================================================================
|
||||||
|
* Bug fix: Fixed broken no-parameter config blocks.
|
||||||
* Added core command SHUTDOWN.
|
* Added core command SHUTDOWN.
|
||||||
* Added core command MODRELOAD.
|
* Added core command MODRELOAD.
|
||||||
* Added core command MODUNLOAD.
|
* Added core command MODUNLOAD.
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ use strict;
|
|||||||
use warnings;
|
use warnings;
|
||||||
|
|
||||||
# Create a new instance.
|
# Create a new instance.
|
||||||
# Funny how we still haven't taken advantage of Mouse/Moose yet.
|
|
||||||
sub new
|
sub new
|
||||||
{
|
{
|
||||||
my $class = shift;
|
my $class = shift;
|
||||||
@@ -104,7 +103,6 @@ sub parse
|
|||||||
my @sblk = split('@@@', $blk);
|
my @sblk = split('@@@', $blk);
|
||||||
|
|
||||||
# Check to see if this config option already exists.
|
# 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]}) {
|
if (defined $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]}) {
|
||||||
# It does, so merely push this second one to the existing array.
|
# It does, so merely push this second one to the existing array.
|
||||||
push(@{ $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]} }, $param);
|
push(@{ $rs{$sblk[0]}{$sblk[1]}{$ebuf[0]} }, $param);
|
||||||
@@ -116,12 +114,11 @@ sub parse
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
# We're inside a block with no parameter.
|
# We're inside a block with no parameter.
|
||||||
$rs{$blk}{$ebuf[0]} = $ebuf[1];
|
|
||||||
|
|
||||||
# Check to see if this config option already exists.
|
# Check to see if this config option already exists.
|
||||||
if (defined $rs{$blk}{$ebuf[0]}) {
|
if (defined $rs{$blk}{$ebuf[0]}) {
|
||||||
# It does, so merely push this second one to the existing array.
|
# 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 {
|
else {
|
||||||
# It doesn't, create it as an array.
|
# It doesn't, create it as an array.
|
||||||
@@ -157,7 +154,7 @@ sub parse
|
|||||||
if (defined $ebuf[1]) {
|
if (defined $ebuf[1]) {
|
||||||
if ($ebuf[1] eq '{') {
|
if ($ebuf[1] eq '{') {
|
||||||
# This is the beginning of a block with no parameter.
|
# This is the beginning of a block with no parameter.
|
||||||
$blk = $ebuf[0];
|
$blk = $ebuf[0];
|
||||||
}
|
}
|
||||||
elsif (defined $ebuf[2]) {
|
elsif (defined $ebuf[2]) {
|
||||||
if ($ebuf[2] eq '{') {
|
if ($ebuf[2] eq '{') {
|
||||||
|
|||||||
Reference in new issue
Block a user