Procházet zdrojové kódy

* Fix serious bug in mIRC/mIRC6 formats which caused lots of warnings to be
outputted.

Morten Brix Pedersen před 22 roky
rodič
revize
7f72069d85

+ 2 - 0
docs/Changelog

@@ -1,5 +1,7 @@
 pisg (x.xx)
    * Added javabot support (thanks, Tobias Larsson)
+   * Fix serious bug in mIRC/mIRC6 formats which caused lots of warnings to be
+     outputted.
 
 pisg (0.54) - Thu Apr, 1st 2004
    * Revert most of the performance improvement changes, they caused bugs.

+ 6 - 2
modules/Pisg/Parser/Format/mIRC.pm

@@ -26,9 +26,13 @@ sub normalline
 
     if ($line =~ /$self->{normalline}/o) {
 
+        print "hour: $1\n";
+        print "nick $2\n";
+        print "saying $3\n";
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
         $hash{saying} = $3;
+        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
+        print "saying.pm: $hash{saying}\n";
 
         return \%hash;
     } else {
@@ -44,8 +48,8 @@ sub actionline
     if ($line =~ /$self->{actionline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
         $hash{saying} = $3;
+        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
 
         return \%hash;
     } else {

+ 3 - 3
modules/Pisg/Parser/Format/mIRC6.pm

@@ -26,8 +26,8 @@ sub normalline
     if ($line =~ /$self->{normalline}/o) {
 
         $hash{hour}   = $1;
-        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
         $hash{saying} = $3;
+        ($hash{nick}  = $2) =~ s/^[@%\+]//o; # Remove prefix
 
         return \%hash;
     } else {
@@ -54,8 +54,8 @@ sub thirdline
 
         $hash{hour} = $1;
         $hash{min}  = $2;
-        $hash{saying}  = $3;
-        ($hash{nick}  = $line[0]) =~ s/^[@%\+]//o; # Remove prefix
+        $hash{saying} = $3;
+        ($hash{nick} = $line[0]) =~ s/^[@%\+]//o; # Remove prefix
 
         if ($#line >= 4 && ($line[1].$line[2]) eq 'waskicked' && ($line[$#line] =~ /\)$/)) {
                 $hash{kicker} = $line[4];