httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject Re: apache_1.2b1: mod_expires.c: index() function not portable (fwd)
Date Wed, 04 Dec 1996 18:53:27 GMT
+1

> Blimey. This would appear to be the _only_ use of index() in the entire source.
> I vote we adopt this change, and remove all index() portability stuff from the
> headers.
> 
> Cheers,
> 
> Ben.
> 
> Rob Hartill wrote:
> > 
> > 
> > acked.
> > 
> > ----- Forwarded message from Martin Kraemer -----
> > 
> > Hi again,
> > 
> > After modifying GuessOS and compiling I got an error from the linker:
> > 
> >     Undefined                       first referenced
> >      symbol                             in file
> >     index                               mod_expires.o
> >     ld: httpd: fatal error: Symbol referencing errors. No output written to httpd
> > 
> > This is due to the fact that index() is not totally portable, on SVR4
> > systems (like mine: SINIX and Reliant Unix are SNI's SVR4.2) it's not in
> > the default libc.
> > 
> > Here's a patch to improve both portability and performance:
> > 
> > Index: mod_expires.c
> > ===================================================================
> > RCS file: /home/cvs/apache_1.2b1/src/mod_expires.c,v
> > retrieving revision 1.1
> > retrieving revision 1.2
> > diff -u -r1.1 -r1.2
> > --- mod_expires.c	1996/12/04 12:59:44	1.1
> > +++ mod_expires.c	1996/12/04 14:26:19	1.2
> > @@ -187,6 +187,7 @@
> >   * Hi, welcome to the internet.
> >   */
> >  
> > +#include <ctype.h>
> >  #include "httpd.h"
> >  #include "http_config.h"
> >  #include "http_log.h"
> > @@ -277,7 +278,7 @@
> >      while ( word[0] ) {
> >  	/* <num>
> >  	 */
> > -	if ( index("0123456789", word[0]) != NULL ) {
> > +	if ( isdigit(word[0]) ) {
> >  	    num = atoi( word );
> >  	} else {
> >              return pstrcat( pool, "bad expires code, numeric value expected <num>
'",
> > 
> > -- 
> > | S I E M E N S |  <Martin.Kraemer@mch.sni.de>  |      Siemens Nixdorf
> > | ------------- |   Voice: +49-89-636-46021     |  Informationssysteme AG
> > | N I X D O R F |   FAX:   +49-89-636-44994     |   81730 Munich, Germany
> > ~~~~~~~~~~~~~~~~My opinions only, of course; pgp key available on request
> > 
> > ----- End of forwarded message from Martin Kraemer -----
> > 
> 
> -- 
> Ben Laurie                Phone: +44 (181) 994 6435  Email: ben@algroup.co.uk
> Freelance Consultant and  Fax:   +44 (181) 994 6472
> Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
> A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
> London, England.          Apache-SSL author




Mime
View raw message