On Wed, 28 Jan 2004, Igor Pechtchanski wrote:
> [snip]
> A package search at <http://cygwin.com/packages/> for "bin/g\+\+.exe"
> should have found it, but there seems to be a bug (which I'm looking
> into) that truncates the match list before it displays "gcc-g++", which
> may have prompted this question.
Ok, I found the bug. The raw filename of the gcc-g++ package wasn't
quoted in the pattern. Since it contained '+'s, which are magic pattern
characters in perl, the pattern wasn't correct anyway. Since it contained
two of them in a row (and a regular character or construct is required
before a '+' in perl patterns), perl choked. The attached patch fixes
this. Permission to commit?
Igor
P.S. The same problem will happen (in a different place) if one searches
for 'g++'. There is a way to escape the '+'s in this case, though (by
searching for 'g\+\+' instead), and I don't think we want to disallow the
full RE searches just yet... Just in case, I have a patch ready for that,
too.
P.P.S. Should this have been sent to another list instead?
==============================================================================
ChangeLog:
2004-01-28 Igor Pechtchanski <[EMAIL PROTECTED]>
* package-grep.cgi (findheader): Quote raw filename in pattern.
--
http://cs.nyu.edu/~pechtcha/
|\ _,,,---,,_ [EMAIL PROTECTED]
ZZZzz /,`.-'`' -. ;-;;,_ [EMAIL PROTECTED]
|,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D.
'---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow!
"I have since come to realize that being between your mentor and his route
to the bathroom is a major career booster." -- Patrick Naughton
Index: package-grep.cgi
===================================================================
RCS file: /cvs/cygwin/htdocs/cgi-bin2/package-grep.cgi,v
retrieving revision 1.26
diff -u -p -r1.26 package-grep.cgi
--- package-grep.cgi 15 Nov 2001 07:48:36 -0000 1.26
+++ package-grep.cgi 29 Jan 2004 00:25:49 -0000
@@ -66,6 +66,6 @@ sub addfn($) {
sub findheader {
my $p = shift;
- my $header = ($_[0] =~ m!^.*<a href=.*?>$p</a>.*?<td.*?>([^><]+)<!m)[0];
+ my $header = ($_[0] =~ m!^.*<a href=.*?>\Q$p\E</a>.*?<td.*?>([^><]+)<!m)[0];
return $header || '';
}
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/