This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix for broken package-grep.cgi (Attn: CGF)


On Wed, 28 Jan 2004, Christopher Faylor wrote:

> On Wed, Jan 28, 2004 at 07:38:26PM -0500, Igor Pechtchanski wrote:
>
> >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.
>
> We don't want to disable regex searches.  This is correct.

Well, then, we should produce meaningful error messages on broken regexes,
instead of filling the server log.  Something like the code below should
do it...

unless (eval { local $_=""; /$grep/o; } or $@ !~ /regex/) {
    print "<b>$grep</b>: invalid regex!<br><br>\n";
} else {
    # Do our stuff
}

Should I get this working and check it in?

> >ChangeLog:
> >2004-01-28  Igor Pechtchanski  <pechtcha@cs.nyu.edu>
> >
> >       * package-grep.cgi (findheader): Quote raw filename in pattern.
>
> Please check in.
> Thanks,
> cgf

Done.
	Igor
-- 
				http://cs.nyu.edu/~pechtcha/
      |\      _,,,---,,_		pechtcha@cs.nyu.edu
ZZZzz /,`.-'`'    -.  ;-;;,_		igor@watson.ibm.com
     |,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

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]