httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject apache_1.2b1: mod_expires.c: index() function not portable (fwd)
Date Wed, 04 Dec 1996 14:51:25 GMT

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


Mime
View raw message