Subject: | SVN-Notify-0.26 breaks SVN::Notify::Config (and others) |
Date: | Thu, 24 May 2007 08:41:42 -0400 |
To: | John Peacock via RT <bug-SVN-Notify [...] rt.cpan.org> |
From: | John Peacock <jpeacock [...] rowman.com> |
I got a bug report vs. SVN::Notify::Config for test failures:
http://rt.cpan.org/Ticket/Display.html?id=26209
and it took me ages to recreate it (since I didn't notice that you'd
updated SVN::Notify). Once it was pointed out that it was 0.26 that
triggers the error, I was able to finally debug it.
The problem is this line:
--- lib/SVN/Notify.pm~ 2007-03-27 03:00:40.000000000 -0400
+++ lib/SVN/Notify.pm 2007-05-24 06:08:56.000000000 -0400
@@ -955,7 +955,7 @@ sub prepare_recipients {
if (/$rx/) {
$self->_dbpnt( qq{"$_" matched $rx}) if
$self->{verbose} > 2;
push @$tos, $email unless $seen{$email}++;
- splice @$regexen, $i, 2;
+ #splice @$regexen, $i, 2;
}
}
# Grab the context if it's needed for the subject.
You are iterating over the $regexen using a loop, but in the line above
you are splicing out any regex that matches. The end result is that
everytime you match one of the regexes, you are *skipping* the next
regex (since you can't both iterate over the index of the array *and*
remove array elements casually).
The above trivial patch restores SVN::Notify::Config's tests.
Thanks
John
p.s. RT.cpan.org seems to be on the fritz, which is why I am cc'ing you
directly...
--
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Blvd
Suite H
Lanham, MD 20706
301-459-3366 x.5010
fax 301-429-5747