(Yes, I'm replying to my own email; bad habit of mine).

Poked around a bit more and found that if I do away with the $_ stuff 
within the function that seems to work.  Like I said I've never really 
understood it, but my guess is something's phishy there.

Patch attached fixes the issue for me entirely while maintaining the 
ability for the rule to hit multiple times on a single line, though I'm 
sure there might be a better way and am curious as to why simple 
reassignment fixes it.  No idea if it meets the general coding 
standards/practices; mostly just meant as a "hey this seems to fix the 
problem" patch :P.

Once I apply this patch - all regexes (original ones, trivial ones, new 
ones you've been cooking) *no longer* trigger the loop.  Huzzah.

Matt






-- 
  Matt Elson
  [email protected]

--- OneLineBodyRuleType.pm.orig 2010-03-16 10:49:21.000000000 -0400
+++ OneLineBodyRuleType.pm      2011-03-22 09:26:06.628565077 -0400
@@ -97,7 +97,8 @@
       $sub = '
       pos $_[1] = 0;
       '.$self->hash_line_for_rule($pms, $rulename).'
-      while ($_[1] =~ '.$pat.'g) {
+      my $line = $_[1];
+      while ($line =~ '.$pat.'g) {
         my $self = $_[0];
         $self->got_hit(q{'.$rulename.'}, "BODY: ", ruletype => 
"one_line_body");
         '. $self->hit_rule_plugin_code($pms, $rulename, "one_line_body",

Reply via email to