Преглед изворни кода

Fixed breakage when multiple LogDirs were given

Christoph Berg пре 21 година
родитељ
комит
dcbd27df82
2 измењених фајлова са 5 додато и 5 уклоњено
  1. 2 0
      docs/Changelog
  2. 3 5
      modules/Pisg/Parser/Logfile.pm

+ 2 - 0
docs/Changelog

@@ -2,6 +2,8 @@ pisg (0.65) - ??
    Christoph:
    * Karma didn't work well with nick aliases. It's still far from perfect,
      though (thanks to Nico for the test log).
+   * Fixed breakage when multiple LogDirs were given (thanks to Toni Viemerö
+     for the report, SF tracker #1155433).
 
 pisg (0.64) - Thu Feb, 24th 2005
    Morten:

+ 3 - 5
modules/Pisg/Parser/Logfile.pm

@@ -97,8 +97,8 @@ sub analyze
     # expand wildcards
     @logfiles = map { if(/[\[*?]/) { glob; } else { $_; } } @logfiles;
 
-    if (scalar(@{$self->{cfg}->{logdir}}) > 0) {
-        push @logfiles, $self->_parse_dir(); # get all files in dir
+    foreach my $logdir (@{$self->{cfg}->{logdir}}) {
+        push @logfiles, $self->_parse_dir($logdir); # get all files in dir
     }
 
     my $count = @logfiles;
@@ -146,9 +146,8 @@ sub analyze
 sub _parse_dir
 {
     my $self = shift;
+    my $logdir = shift;
 
-    # Loop through each logdir we were given
-    foreach my $logdir (@{$self->{cfg}->{logdir}}) {
         # Add trailing slash when it's not there..
         $logdir =~ s/([^\/])$/$1\//;
 
@@ -234,7 +233,6 @@ sub _parse_dir
         }
 
         return map { "$logdir$_" } @filesarray;
-    }
 }
 
 # This parses the file...