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 2005/07/12 03:28:33 UTC

svn commit: r215906 - /spamassassin/trunk/masses/enable-all-evolved-rules

Author: jm
Date: Mon Jul 11 18:28:31 2005
New Revision: 215906

URL: http://svn.apache.org/viewcvs?rev=215906&view=rev
Log:
damn, there can be multiple mutable sections

Modified:
    spamassassin/trunk/masses/enable-all-evolved-rules

Modified: spamassassin/trunk/masses/enable-all-evolved-rules
URL: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/enable-all-evolved-rules?rev=215906&r1=215905&r2=215906&view=diff
==============================================================================
--- spamassassin/trunk/masses/enable-all-evolved-rules (original)
+++ spamassassin/trunk/masses/enable-all-evolved-rules Mon Jul 11 18:28:31 2005
@@ -29,13 +29,17 @@
 
 use strict;
 
-while (<>) {
-  print;
-  last if /<gen:mutable>/;
-}
+my $in_mut_sect = 0;
 
 while (<>) {
-  if (/^\s*score\s+(.+?)$/) {
+  if (/<gen:mutable>/) {
+    $in_mut_sect = 1;
+  }
+  elsif (/<\/gen:mutable>/) {
+    $in_mut_sect = 0;
+  }
+
+  if ($in_mut_sect && /^\s*score\s+(.+?)$/) {
     my @vals = split(' ', $1);
     my $new = '';
     foreach my $score (@vals) {
@@ -45,14 +49,11 @@
         $new .= "$score ";
       }
     }
+    $new =~ s/ +$//;
     print "score $new\n";
   }
   else {
     print;
   }
-  last if /<\/gen:mutable>/;
 }
 
-while (<>) {
-  print;
-}