httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: cvs commit: apache-1.3/src/modules/standard mod_log_referer.c
Date Wed, 20 May 1998 21:01:26 GMT
Brian Behlendorf wrote:
> 
> On Wed, 20 May 1998, Dean Gaudet wrote:
> > On 20 May 1998 brian@hyperreal.org wrote:
> >
> > >   @@ -175,7 +176,7 @@
> > >        referer = ap_table_get(orig->headers_in, "Referer");
> > >        if (referer != NULL) {
> > >
> > >   -
> > >   +        ap_str_tolower(referer);
> > >            /* The following is an upsetting mess of pointers, I'm sorry
> > >               Anyone with the motiviation and/or the time should feel free
> > >               to make this cleaner... */
> >
> > -1.  This patch is broken.  You cannot downcase the value you get from
> > table_get()... the values in all tables are constants.  You should replace
> > the to str_tolower()s with a single strcasecmp() or whatever.
> 
> The comparison is a strstr though; so far as I know there isn't a
> strcasestr available.  I suppose I can use regex... or just create a
> new buffer.
> 
> Odd that the patch seemed to work fine, no compile errors and testing
> showed it did the job...

That's coz ap_table_get() returns a char * instead of a const char *, I
guess.

Cheers,

Ben.

-- 
Ben Laurie            |Phone: +44 (181) 735 0686|  Apache Group member
Freelance Consultant  |Fax:   +44 (181) 735 0689|http://www.apache.org
and Technical Director|Email: ben@algroup.co.uk |
A.L. Digital Ltd,     |Apache-SSL author    http://www.apache-ssl.org/
London, England.      |"Apache: TDG" http://www.ora.com/catalog/apache

Mime
View raw message