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/01/21 05:10:20 UTC

svn commit: r125885 - /spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla

Author: jm
Date: Thu Jan 20 20:10:19 2005
New Revision: 125885

URL: http://svn.apache.org/viewcvs?view=rev&rev=125885
Log:
support comments too
Modified:
   spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla

Modified: spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla
Url: http://svn.apache.org/viewcvs/spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla?view=diff&rev=125885&p1=spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla&r1=125884&p2=spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla&r2=125885
==============================================================================
--- spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla	(original)
+++ spamassassin/trunk/masses/rule-qa/automc/scrape-bugzilla	Thu Jan 20 20:10:19 2005
@@ -358,8 +358,12 @@
   my $seenrules = 0;
   my $lastwasrule = 0;
   foreach my $line (split(/^/m, $text)) {
+    $line =~ s/(?<!\\)#.*$//;# remove comments
+    $line =~ s/^\s+//;  # remove leading whitespace
+    $line =~ s/\s+$//;  # remove tailing whitespace
+
     if ($line =~ 
-/^\s*(header|rawbody|body|full|meta|uri|score|describe|tflags)\s+(\S+)\s+(.*)$/
+/^\s*(header|urirhsbl|uribl|rawbody|body|full|meta|uri|score|describe|tflags)\s+(\S+)\s+(.*)$/
       )
     {
       my $type = $1;
@@ -376,7 +380,7 @@
       if ($line =~ /\S/) {
         if ($lastwasrule) {
           # assume it's a continuation of the last line
-          chop($cmt->{mcrules});
+          chomp ($cmt->{mcrules});
           $cmt->{mcrules} .= "$line\n";
         }
       }