Received: by taz.hyperreal.com (8.8.3/V2.0) id KAA17019; Wed, 4 Dec 1996 10:52:46 -0800 (PST) Received: from sierra.zyzzyva.com by taz.hyperreal.com (8.8.3/V2.0) with ESMTP id KAA17005; Wed, 4 Dec 1996 10:52:40 -0800 (PST) Received: from sierra.zyzzyva.com (localhost [127.0.0.1]) by sierra.zyzzyva.com (8.8.2/8.8.2) with ESMTP id MAA12687; Wed, 4 Dec 1996 12:53:28 -0600 (CST) Message-Id: <199612041853.MAA12687@sierra.zyzzyva.com> To: ben@algroup.co.uk, new-httpd@hyperreal.com Subject: Re: apache_1.2b1: mod_expires.c: index() function not portable (fwd) In-reply-to: ben's message of Wed, 04 Dec 1996 17:43:30 +0000. <9612041743.aa26216@gonzo.ben.algroup.co.uk> X-uri: http://www.zyzzyva.com/ Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 04 Dec 1996 12:53:27 -0600 From: Randy Terbush Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@hyperreal.com +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 > > #include "httpd.h" > > #include "http_config.h" > > #include "http_log.h" > > @@ -277,7 +278,7 @@ > > while ( word[0] ) { > > /* > > */ > > - if ( index("0123456789", word[0]) != NULL ) { > > + if ( isdigit(word[0]) ) { > > num = atoi( word ); > > } else { > > return pstrcat( pool, "bad expires code, numeric value expected '", > > > > -- > > | S I E M E N S | | 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