Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the SVN-Notify CPAN distribution.

Report information
The Basics
Id: 29051
Status: resolved
Priority: 0/
Queue: SVN-Notify

People
Owner: Nobody in particular
Requestors: wdavison [...] sourceforge.net
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 2.67



Subject: Two problems with dir-changed paths in regex match
Date: Wed, 29 Aug 2007 10:59:04 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: Wayne Davison <wdavison [...] sourceforge.net>
The code that matches the directory prefix needs a couple fixes. Here is the original code: $cx ||= $_; $cx =~ s{[/\\]?[^/\\]+$}{} until !$cx || /^$cx/; The $_ variable holds a path that was output by dirs-changed. If that path contains one or more regex chars (such as '+'), it will either match inconsistently, or the regex will fail to compile. To fix this, I added \Q and \E around the $cx variable. The second problem is that a directory prefix could match a longer-named directory. For instance, if $_ had the value "/some/path2" and $cw had the value "/some/path", it would match rather than being shortened to "/some". To fix this, I added a requirement that the end of the $cw string must be at a slash, at a backslash, or at the end of the $_ string. Attached is a patch that fixes both problems. ..wayne..
--- Notify.pm.old 2007-06-16 22:08:29 -0700 +++ Notify.pm 2007-08-29 10:28:11 -0700 @@ -974,7 +974,7 @@ # XXX Do we need to set utf8 here? my $l = length; $cx ||= $_; - $cx =~ s{[/\\]?[^/\\]+$}{} until !$cx || /^$cx/; + $cx =~ s{[/\\]?[^/\\]+$}{} until !$cx || m{^\Q$cx\E(/|\\|$)}; } } $self->_dbpnt( qq{Context is "$cx"})
Subject: Re: [rt.cpan.org #29051] Two problems with dir-changed paths in regex match
Date: Wed, 29 Aug 2007 14:45:47 -0700
To: bug-SVN-Notify [...] rt.cpan.org
From: "David E. Wheeler" <david [...] kineticode.com>
On Aug 29, 2007, at 11:09, Wayne Davison via RT wrote: Show quoted text
> The code that matches the directory prefix needs a couple fixes.
Patch applied, thanks. I plan to get back to SVN::Notify to make some other improvements soon, so watch for an updated version in the next few weeks. Best, David