Closed Bug 133179 Opened 22 years ago Closed 22 years ago

[HAVE REVIEW] Lots of empty lists remain in config file

Categories

(Webtools Graveyard :: Mozbot, defect, P1)

x86
Linux
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: ian, Assigned: ian)

Details

from my config file:

MagicEightBall::allowusers
MagicEightBall::channelsBlocked
MagicEightBall::denyusers
MagicEightBall::allowusers
MagicEightBall::channelsBlocked
MagicEightBall::denyusers
MagicEightBall::allowusers
MagicEightBall::channelsBlocked
MagicEightBall::denyusers
Status: NEW → ASSIGNED
Priority: -- → P1
Target Milestone: --- → Mozbot 2.4
Index: lib/Configuration.pm===================================================================RCS file: /cvsroot/mozilla/webtools/mozbot/lib/Configuration.pm,vretrieving revision 2.1diff -u -r2.1 Configuration.pm--- lib/Configuration.pm	26 Feb 2002 22:48:35 -0000	2.1+++ lib/Configuration.pm	25 Mar 2002 00:50:57 -0000@@ -89,7 +89,7 @@     my %seen;     foreach (@lines) {         chomp;-        if (/^ *([^#;][^=\n\r]*)=(.*)$/os) {+        if (/^ *([^#;][^=\n\r]*)(?:=(.*))?$/os) {             if (defined($$config{$1})) {                 unless ($seen{$1}) {                     my $value = $$config{$1};@@ -135,7 +135,11 @@                     $seen{$1} = 1;                 } # else seen it already             } else { # unknown-                print FILE "$1=$2\n";+                if (defined($2)) {+                    print FILE "$1=$2\n";+                } else {+                    print FILE "$1\n";+                }             }         } else {             # might be a comment
Keywords: review
Summary: Lots of empty lists remain in config file → [HAVE FIX] Lots of empty lists remain in config file
yay konqueror. Mark II:

Index: lib/Configuration.pm
===================================================================
RCS file: /cvsroot/mozilla/webtools/mozbot/lib/Configuration.pm,v
retrieving revision 2.1
diff -u -r2.1 Configuration.pm
--- lib/Configuration.pm	26 Feb 2002 22:48:35 -0000	2.1
+++ lib/Configuration.pm	25 Mar 2002 01:34:19 -0000
@@ -89,7 +89,7 @@
     my %seen;
     foreach (@lines) {
         chomp;
-        if (/^ *([^#;][^=\n\r]*)=(.*)$/os) {
+        if (/^ *([^#;][^=\n\r]*)(?:=(.*))?$/os) {
             if (defined($$config{$1})) {
                 unless ($seen{$1}) {
                     my $value = $$config{$1};
@@ -135,7 +135,11 @@
                     $seen{$1} = 1;
                 } # else seen it already
             } else { # unknown
-                print FILE "$1=$2\n";
+                if (defined($2)) {
+                    print FILE "$1=$2\n";
+                } else {
+                    print FILE "$1\n";
+                }
             }
         } else {
             # might be a comment
QA Contact: timeless → kerz
<timeless> 133179 is fine.
r=timeless
Keywords: review
Summary: [HAVE FIX] Lots of empty lists remain in config file → [HAVE REVIEW] Lots of empty lists remain in config file
Checked in.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
QA Contact: kerz → mozbot
Verified Fixed.
Status: RESOLVED → VERIFIED
Product: Webtools → Webtools Graveyard
You need to log in before you can comment on or make changes to this bug.