You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2006/12/20 14:29:19 UTC

svn commit: r489084 - /spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm

Author: jm
Date: Wed Dec 20 05:29:18 2006
New Revision: 489084

URL: http://svn.apache.org/viewvc?view=rev&rev=489084
Log:
when using format=detect, format would be set by the first file/dir/mbox in a glob and then reused by all other locations; this was breaking the bb- mass-checks

Modified:
    spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm

Modified: spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm?view=diff&rev=489084&r1=489083&r2=489084
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/ArchiveIterator.pm Wed Dec 20 05:29:18 2006
@@ -483,35 +483,38 @@
     foreach my $location (@locations) {
       my $method;
 
+      # for this location only; 'detect' means they can differ for each location
+      my $thisformat = $format;     
+
       if ($format eq 'detect') {
 	# detect the format
         if (!-d $location && $location =~ /\.mbox/i) {
           # filename indicates mbox
-          $format = 'mbox';
+          $thisformat = 'mbox';
         } 
 	elsif (!(-d $location)) {
-          $format = 'file';
+          $thisformat = 'file';
 	}
 	else {
 	  # it's a directory
-	  $format = 'dir';
+	  $thisformat = 'dir';
 	}
       }
 
-      if ($format eq 'dir') {
+      if ($thisformat eq 'dir') {
         $method = \&_scan_directory;
       }
-      elsif ($format eq 'mbox') {
+      elsif ($thisformat eq 'mbox') {
         $method = \&_scan_mailbox;
       }
-      elsif ($format eq 'file') {
+      elsif ($thisformat eq 'file') {
         $method = \&_scan_file;
       }
-      elsif ($format eq 'mbx') {
+      elsif ($thisformat eq 'mbx') {
         $method = \&_scan_mbx;
       }
       else {
-	warn "archive-iterator: format $format unknown!";
+	warn "archive-iterator: format $thisformat (from $format) unknown!";
         next;
       }