[cvsspam-devel] Buggage in my last patches

Charles Duffy cduffy at spamcop.net
Fri Jun 2 13:39:26 UTC 2006


Folks,

I owe a big "mea culpa".

Several of the patches I've submitted have included regular expressions 
with grouping operators. These can cause idx in MultiSub#gsub! to have a 
different value than expected, and is otherwise a Bad Thing.

The relevant snippet from my cvsspam.rb now looks like this:

if $bugzillaURL != nil
   commentSubstitutions['\b[Bb](?:[Uu][Gg])?\s*[#:]?\s*\[?[0-9]+\]?'] = 
bugzillaSub
end
if $jiraURL != nil
   commentSubstitutions['\b[a-zA-Z]+-[0-9]+\b'] = jiraSub
end
if $ticketURL != nil
   commentSubstitutions['\b[Tt][Ii][Cc][Kk][Ee][Tt]\s*#?[0-9]+\b'] = 
ticketSub
end
if $wikiURL != nil
   commentSubstitutions['\[\[.+\]\]'] = wikiSub
end
if $xplannerIterationURL != nil
   commentSubstitutions['\b(?:XI|xi)\[?[0-9]+\]?'] = xplannerIterationSub
end
if $xplannerProjectURL != nil
   commentSubstitutions['\b(?:XP|xp)\[?[0-9]+\]?'] = xplannerProjectSub
end
if $xplannerStoryURL != nil
   commentSubstitutions['\b(?:XS|xs)\[?[0-9]+\]?'] = xplannerStorySub
end
if $xplannerTaskURL != nil
   commentSubstitutions['\b(?:XT|xt)\[?[0-9]+\]?'] = xplannerTaskSub
end
$commentEncoder = MultiSub.new(commentSubstitutions)



More information about the cvsspam-devel mailing list