Parcourir la source

Fixed breakage when multiple LogDirs were given

Christoph Berg il y a 21 ans
Parent
commit
dcbd27df82
2 fichiers modifiés avec 5 ajouts et 5 suppressions
  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:
    Christoph:
    * Karma didn't work well with nick aliases. It's still far from perfect,
    * Karma didn't work well with nick aliases. It's still far from perfect,
      though (thanks to Nico for the test log).
      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
 pisg (0.64) - Thu Feb, 24th 2005
    Morten:
    Morten:

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

@@ -97,8 +97,8 @@ sub analyze
     # expand wildcards
     # expand wildcards
     @logfiles = map { if(/[\[*?]/) { glob; } else { $_; } } @logfiles;
     @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;
     my $count = @logfiles;
@@ -146,9 +146,8 @@ sub analyze
 sub _parse_dir
 sub _parse_dir
 {
 {
     my $self = shift;
     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..
         # Add trailing slash when it's not there..
         $logdir =~ s/([^\/])$/$1\//;
         $logdir =~ s/([^\/])$/$1\//;
 
 
@@ -234,7 +233,6 @@ sub _parse_dir
         }
         }
 
 
         return map { "$logdir$_" } @filesarray;
         return map { "$logdir$_" } @filesarray;
-    }
 }
 }
 
 
 # This parses the file...
 # This parses the file...