dgaudet 98/07/08 10:47:30
Modified: src CHANGES Configure src/ap ap_snprintf.c src/include conf.h hsregex.h src/main fnmatch.c gen_test_char.c http_protocol.c util.c util_date.c util_script.c src/modules/proxy proxy_ftp.c proxy_http.c proxy_util.c src/modules/standard mod_access.c mod_alias.c mod_autoindex.c mod_cern_meta.c mod_digest.c mod_expires.c mod_imap.c mod_include.c mod_log_config.c mod_mime.c mod_mime_magic.c mod_negotiation.c mod_rewrite.c mod_speling.c mod_usertrack.c src/os/bs2000 bs2login.c src/os/win32 mod_isapi.c util_win32.c src/regex debug.c engine.c regcomp.c regex2.h Added: src/include apctype.h Log: Implement 8-bit ctype suggestion #2 modified by Roy's (unsigned char) suggestion because Iain Brown <[EMAIL PROTECTED]> pointed out that my logic regarding the casting was wrong. This compiles and runs/works on both Linux and Solaris 2.6. I'm totally willing to back it out if there are complaints, I just figure this is the best way to get widespread multiplatform testing. To test you need to request a URL with character 246 (ö), and you should create a .htaccess in a directory with an AddDescription containing character 246 as well. (Actually, trying 240 through 255 would be good.) PR: 800, 2282, 2553 (and others) Revision Changes Path 1.954 +5 -6 apache-1.3/src/CHANGES Index: CHANGES =================================================================== RCS file: /export/home/cvs/apache-1.3/src/CHANGES,v retrieving revision 1.953 retrieving revision 1.954 diff -u -r1.953 -r1.954 --- CHANGES 1998/07/08 16:54:31 1.953 +++ CHANGES 1998/07/08 17:46:53 1.954 @@ -5,12 +5,11 @@ *) suexec's error messages have been clarified a little bit. [Ken Coar] - *) PORT: Apache is not 8-bit clean in many settings, a problem we're - aware of and intend to fix properly. But a temporary workaround - which should work for many folks is to tell the C compiler to use - "unsigned char"s. For gcc this means adding -funsigned-char. - -funsigned-char is the default now for Linux 2.x and FreeBSD - 2 and 3. [Dean Gaudet] PR#800, 2282, 2553 + *) Clean up some, but perhaps not all, 8-bit character set problems + with config file parsing, and URL parsing. We now define + ap_isdigit(), ap_isupper(), ... which cast to an (unsigned char). + This should work on most modern unixes. + [Dean Gaudet] PR#800, 2282, 2553 (and others) *) The "handler not found" error was issued in cases where the handler really did exist, but was just declining to serve the request. 1.273 +1 -1 apache-1.3/src/Configure Index: Configure =================================================================== RCS file: /export/home/cvs/apache-1.3/src/Configure,v retrieving revision 1.272 retrieving revision 1.273 diff -u -r1.272 -r1.273 --- Configure 1998/07/07 17:23:19 1.272 +++ Configure 1998/07/08 17:46:53 1.273 @@ -432,7 +432,7 @@ *-linux2) DEF_WANTHSREGEX=yes OS='Linux' - CFLAGS="$CFLAGS -DLINUX=2 -funsigned-char" + CFLAGS="$CFLAGS -DLINUX=2" LIBS="$LIBS -lm" ;; *-linux1) 1.26 +5 -5 apache-1.3/src/ap/ap_snprintf.c Index: ap_snprintf.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/ap/ap_snprintf.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -r1.25 -r1.26 --- ap_snprintf.c 1998/06/04 20:13:15 1.25 +++ ap_snprintf.c 1998/07/08 17:46:56 1.26 @@ -288,7 +288,7 @@ #define STR_TO_DEC( str, num ) \ num = NUM( *str++ ) ; \ - while ( isdigit( *str ) ) \ + while ( ap_isdigit( *str ) ) \ { \ num *= 10 ; \ num += NUM( *str++ ) ; \ @@ -448,7 +448,7 @@ /* * Check for Infinity and NaN */ - if (isalpha(*p)) { + if (ap_isalpha(*p)) { *len = strlen(strcpy(buf, p)); *is_negative = FALSE; return (buf); @@ -608,7 +608,7 @@ /* * Try to avoid checking for flags, width or precision */ - if (isascii(*fmt) && !islower(*fmt)) { + if (!ap_islower(*fmt)) { /* * Recognize flags: -, #, BLANK, + */ @@ -630,7 +630,7 @@ /* * Check if a width was specified */ - if (isdigit(*fmt)) { + if (ap_isdigit(*fmt)) { STR_TO_DEC(fmt, min_width); adjust_width = YES; } @@ -656,7 +656,7 @@ if (*fmt == '.') { adjust_precision = YES; fmt++; - if (isdigit(*fmt)) { + if (ap_isdigit(*fmt)) { STR_TO_DEC(fmt, precision); } else if (*fmt == '*') { 1.220 +1 -4 apache-1.3/src/include/conf.h Index: conf.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/conf.h,v retrieving revision 1.219 retrieving revision 1.220 diff -u -r1.219 -r1.220 --- conf.h 1998/07/08 00:46:05 1.219 +++ conf.h 1998/07/08 17:46:59 1.220 @@ -301,7 +301,6 @@ #define NO_SETSID #define NEED_STRDUP #define HAVE_SYSLOG 1 -#define tolower(c) (isupper(c) ? tolower(c) : c) #elif defined(NEXT) typedef unsigned short mode_t; @@ -777,8 +776,6 @@ #define NO_KILLPG #define NEED_INITGROUPS -#define isascii(c) (!((c) & ~0177)) - #elif defined(WIN32) /* All windows stuff is now in os/win32/os.h */ @@ -883,7 +880,7 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <ctype.h> +#include "apctype.h" #if !defined(MPE) && !defined(WIN32) #include <sys/file.h> #endif 1.8 +4 -0 apache-1.3/src/include/hsregex.h Index: hsregex.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/include/hsregex.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- hsregex.h 1998/07/01 01:45:25 1.7 +++ hsregex.h 1998/07/08 17:47:00 1.8 @@ -1,5 +1,9 @@ #ifndef _REGEX_H_ #define _REGEX_H_ /* never again */ + +/* for 8-bit ctype stuff */ +#include "apctype.h" + /* ========= begin header generated by ./mkh ========= */ #ifdef __cplusplus extern "C" { 1.1 apache-1.3/src/include/apctype.h Index: apctype.h =================================================================== /* ==================================================================== * Copyright (c) 1998 The Apache Group. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. * * 3. All advertising materials mentioning features or use of this * software must display the following acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * 4. The names "Apache Server" and "Apache Group" must not be used to * endorse or promote products derived from this software without * prior written permission. For written permission, please contact * [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache" * nor may "Apache" appear in their names without prior written * permission of the Apache Group. * * 6. Redistributions of any form whatsoever must retain the following * acknowledgment: * "This product includes software developed by the Apache Group * for use in the Apache HTTP server project (http://www.apache.org/)." * * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * ==================================================================== * * This software consists of voluntary contributions made by many * individuals on behalf of the Apache Group and was originally based * on public domain software written at the National Center for * Supercomputing Applications, University of Illinois, Urbana-Champaign. * For more information on the Apache Group and the Apache HTTP server * project, please see <http://www.apache.org/>. * * This code is based on, and used with the permission of, the * SIO stdio-replacement strx_* functions by Panos Tsirigotis * <[EMAIL PROTECTED]> for xinetd. */ #ifndef APACHE_APCTYPE_H #define APACHE_APCTYPE_H #include <ctype.h> #ifdef __cplusplus extern "C" { #endif /* These macros allow correct support of 8-bit characters on systems which * support 8-bit characters. Pretty dumb how the cast is required, but * that's legacy libc for ya. These new macros do not support EOF like * the standard macros do. Tough. */ #define ap_isalnum(c) (isalnum(((unsigned char)(c)))) #define ap_isalpha(c) (isalpha(((unsigned char)(c)))) #define ap_iscntrl(c) (iscntrl(((unsigned char)(c)))) #define ap_isdigit(c) (isdigit(((unsigned char)(c)))) #define ap_isgraph(c) (isgraph(((unsigned char)(c)))) #define ap_islower(c) (islower(((unsigned char)(c)))) #define ap_isprint(c) (isprint(((unsigned char)(c)))) #define ap_ispunct(c) (ispunct(((unsigned char)(c)))) #define ap_isspace(c) (isspace(((unsigned char)(c)))) #define ap_isupper(c) (isupper(((unsigned char)(c)))) #define ap_tolower(c) (tolower(((unsigned char)(c)))) #define ap_toupper(c) (toupper(((unsigned char)(c)))) #ifdef __cplusplus } #endif #endif /* !APACHE_APCTYPE_H */ 1.14 +4 -4 apache-1.3/src/main/fnmatch.c Index: fnmatch.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/fnmatch.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- fnmatch.c 1998/06/30 10:56:16 1.13 +++ fnmatch.c 1998/07/08 17:47:05 1.14 @@ -141,7 +141,7 @@ /* FALLTHROUGH */ default: if (flags & FNM_CASE_BLIND) { - if (tolower(c) != tolower(*string)) { + if (ap_tolower(c) != ap_tolower(*string)) { return (FNM_NOMATCH); } } @@ -188,14 +188,14 @@ } if ((c <= test && test <= c2) || ((flags & FNM_CASE_BLIND) - && ((tolower(c) <= tolower(test)) - && (tolower(test) <= tolower(c2))))) { + && ((ap_tolower(c) <= ap_tolower(test)) + && (ap_tolower(test) <= ap_tolower(c2))))) { ok = 1; } } else if ((c == test) || ((flags & FNM_CASE_BLIND) - && (tolower(c) == tolower(test)))) { + && (ap_tolower(c) == ap_tolower(test)))) { ok = 1; } } 1.4 +3 -3 apache-1.3/src/main/gen_test_char.c Index: gen_test_char.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/gen_test_char.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- gen_test_char.c 1998/04/12 19:02:03 1.3 +++ gen_test_char.c 1998/07/08 17:47:05 1.4 @@ -41,16 +41,16 @@ flags |= T_ESCAPE_SHELL_CMD; } - if (!isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) { + if (!ap_isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) { flags |= T_ESCAPE_PATH_SEGMENT; } - if (!isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) { + if (!ap_isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) { flags |= T_OS_ESCAPE_PATH; } /* these are the "tspecials" from RFC2068 */ - if (iscntrl(c) || strchr(" \t()<>@,;:\\/[]?={}", c)) { + if (ap_iscntrl(c) || strchr(" \t()<>@,;:\\/[]?={}", c)) { flags |= T_HTTP_TOKEN_STOP; } printf("%u%c", flags, (c < 255) ? ',' : ' '); 1.224 +7 -7 apache-1.3/src/main/http_protocol.c Index: http_protocol.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/http_protocol.c,v retrieving revision 1.223 retrieving revision 1.224 diff -u -r1.223 -r1.224 --- http_protocol.c 1998/07/04 16:07:27 1.223 +++ http_protocol.c 1998/07/08 17:47:05 1.224 @@ -740,7 +740,7 @@ /* XXX: RFC2068 defines only SP and HT as whitespace, this test is * wrong... and so are many others probably. */ - while (isspace(*value)) + while (ap_isspace(*value)) ++value; /* Skip to start of value */ /* XXX: should strip trailing whitespace as well */ @@ -1380,7 +1380,7 @@ else if (lenp) { const char *pos = lenp; - while (isdigit(*pos) || isspace(*pos)) + while (ap_isdigit(*pos) || ap_isspace(*pos)) ++pos; if (*pos != '\0') { ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, @@ -2071,11 +2071,11 @@ */ if (r->status_line != NULL && strlen(r->status_line) > 4 /* long enough */ - && isdigit(r->status_line[0]) - && isdigit(r->status_line[1]) - && isdigit(r->status_line[2]) - && isspace(r->status_line[3]) - && isalnum(r->status_line[4])) { + && ap_isdigit(r->status_line[0]) + && ap_isdigit(r->status_line[1]) + && ap_isdigit(r->status_line[2]) + && ap_isspace(r->status_line[3]) + && ap_isalnum(r->status_line[4])) { title = r->status_line; } 1.123 +22 -22 apache-1.3/src/main/util.c Index: util.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util.c,v retrieving revision 1.122 retrieving revision 1.123 diff -u -r1.122 -r1.123 --- util.c 1998/06/19 21:02:42 1.122 +++ util.c 1998/07/08 17:47:06 1.123 @@ -257,7 +257,7 @@ } return -1; } - else if ((exp[y] != '?') && (tolower(str[x]) != tolower(exp[y]))) + else if ((exp[y] != '?') && (ap_tolower(str[x]) != ap_tolower(exp[y]))) return 1; } return (str[x] != '\0'); @@ -308,7 +308,7 @@ while ((c = *src++) != '\0') { if (c == '&') no = 0; - else if (c == '$' && isdigit(*src)) + else if (c == '$' && ap_isdigit(*src)) no = *src++ - '0'; else no = 10; @@ -333,7 +333,7 @@ while ((c = *src++) != '\0') { if (c == '&') no = 0; - else if (c == '$' && isdigit(*src)) + else if (c == '$' && ap_isdigit(*src)) no = *src++ - '0'; else no = 10; @@ -582,7 +582,7 @@ char *res; for (x = 0; (*line)[x]; x++) { - if (isspace((*line)[x])) { + if (ap_isspace((*line)[x])) { pos = x; break; } @@ -597,7 +597,7 @@ res = ap_palloc(atrans, pos + 1); ap_cpystrn(res, *line, pos + 1); - while (isspace((*line)[pos])) + while (ap_isspace((*line)[pos])) ++pos; *line += pos; @@ -663,7 +663,7 @@ char *res; char quote; - while (*str && isspace(*str)) + while (*str && ap_isspace(*str)) ++str; if (!*str) { @@ -686,13 +686,13 @@ } else { strend = str; - while (*strend && !isspace(*strend)) + while (*strend && !ap_isspace(*strend)) ++strend; res = substring_conf(p, str, strend - str, 0); } - while (*strend && isspace(*strend)) + while (*strend && ap_isspace(*strend)) ++strend; *line = strend; return res; @@ -867,23 +867,23 @@ * Leading and trailing white space is eliminated completely */ src = dst = buf; - while (isspace(*src)) + while (ap_isspace(*src)) ++src; while (*src != '\0') { /* Copy words */ - while (!isspace(*dst = *src) && *src != '\0') { + while (!ap_isspace(*dst = *src) && *src != '\0') { ++src; ++dst; } if (*src == '\0') break; *dst++ = ' '; - while (isspace(*src)) + while (ap_isspace(*src)) ++src; } *dst = '\0'; /* blast trailing whitespace */ - while (--dst >= buf && isspace(*dst)) + while (--dst >= buf && ap_isspace(*dst)) *dst = '\0'; #ifdef DEBUG_CFG_LINES @@ -940,7 +940,7 @@ */ } /* blast trailing whitespace */ - while (i > 0 && isspace(buf[i - 1])) + while (i > 0 && ap_isspace(buf[i - 1])) --i; buf[i] = '\0'; #ifdef DEBUG_CFG_LINES @@ -970,7 +970,7 @@ /* Find first non-white byte */ - while (*ptr && isspace(*ptr)) + while (*ptr && ap_isspace(*ptr)) ++ptr; tok_start = ptr; @@ -979,7 +979,7 @@ * (comments are already gone). */ - while (*ptr && (accept_white || !isspace(*ptr)) + while (*ptr && (accept_white || !ap_isspace(*ptr)) && *ptr != ';' && *ptr != ',') { if (*ptr++ == '"') while (*ptr) @@ -992,7 +992,7 @@ /* Advance accept_line pointer to the next non-white byte */ - while (*ptr && isspace(*ptr)) + while (*ptr && ap_isspace(*ptr)) ++ptr; *accept_line = ptr; @@ -1047,7 +1047,7 @@ lidx = llen - tlen; if ((lidx < 0) || - ((lidx > 0) && !(isspace(line[lidx - 1]) || line[lidx - 1] == ','))) + ((lidx > 0) && !(ap_isspace(line[lidx - 1]) || line[lidx - 1] == ','))) return 0; return (strncasecmp(&line[lidx], tok, tlen) == 0); @@ -1309,7 +1309,7 @@ for (x = 0; u[x] != ':'; x++) { if ((!u[x]) || - ((!isalpha(u[x])) && (!isdigit(u[x])) && + ((!ap_isalpha(u[x])) && (!ap_isdigit(u[x])) && (u[x] != '+') && (u[x] != '-') && (u[x] != '.'))) { return 0; } @@ -1364,7 +1364,7 @@ const char *p = a; const char *q = b; for (p = a, q = b; *p && *q; p++, q++) { - int diff = tolower(*p) - tolower(*q); + int diff = ap_tolower(*p) - ap_tolower(*q); if (diff) return diff; } @@ -1389,7 +1389,7 @@ return 0; /* Match up to n characters */ if (!(*p && *q)) return *p - *q; - diff = tolower(*p) - tolower(*q); + diff = ap_tolower(*p) - ap_tolower(*q); if (diff) return diff; } @@ -1503,7 +1503,7 @@ API_EXPORT(void) ap_str_tolower(char *str) { while (*str) { - *str = tolower(*str); + *str = ap_tolower(*str); ++str; } } @@ -1798,7 +1798,7 @@ *semi = '\0'; } while (*str) { - *str = tolower(*str); + *str = ap_tolower(*str); ++str; } if (semi) { 1.12 +5 -5 apache-1.3/src/main/util_date.c Index: util_date.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util_date.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- util_date.c 1998/04/11 12:00:32 1.11 +++ util_date.c 1998/07/08 17:47:06 1.12 @@ -97,15 +97,15 @@ return 1; case '@': - if (!isupper(d)) + if (!ap_isupper(d)) return 0; break; case '$': - if (!islower(d)) + if (!ap_islower(d)) return 0; break; case '#': - if (!isdigit(d)) + if (!ap_isdigit(d)) return 0; break; case '&': @@ -113,7 +113,7 @@ return 0; break; case '~': - if ((d != ' ') && !isdigit(d)) + if ((d != ' ') && !ap_isdigit(d)) return 0; break; default: @@ -231,7 +231,7 @@ if (!date) return BAD_DATE; - while (*date && isspace(*date)) /* Find first non-whitespace char */ + while (*date && ap_isspace(*date)) /* Find first non-whitespace char */ ++date; if (*date == '\0') 1.121 +9 -9 apache-1.3/src/main/util_script.c Index: util_script.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/main/util_script.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -r1.120 -r1.121 --- util_script.c 1998/06/27 18:09:29 1.120 +++ util_script.c 1998/07/08 17:47:06 1.121 @@ -139,11 +139,11 @@ char *cp = res; while (*++cp) { - if (!isalnum(*cp) && *cp != '_') { + if (!ap_isalnum(*cp) && *cp != '_') { *cp = '_'; } else { - *cp = toupper(*cp); + *cp = ap_toupper(*cp); } } @@ -172,11 +172,11 @@ } env[j] = ap_pstrcat(p, elts[i].key, "=", elts[i].val, NULL); whack = env[j]; - if (isdigit(*whack)) { + if (ap_isdigit(*whack)) { *whack++ = '_'; } while (*whack != '=') { - if (!isalnum(*whack) && *whack != '_') { + if (!ap_isalnum(*whack) && *whack != '_') { *whack = '_'; } ++whack; @@ -332,15 +332,15 @@ first = r->the_request; /* use the request-line */ - while (*first && !isspace(*first)) { + while (*first && !ap_isspace(*first)) { ++first; /* skip over the method */ } - while (isspace(*first)) { + while (ap_isspace(*first)) { ++first; /* and the space(s) */ } last = first; - while (*last && !isspace(*last)) { + while (*last && !ap_isspace(*last)) { ++last; /* end at next whitespace */ } @@ -492,7 +492,7 @@ } *l++ = '\0'; - while (*l && isspace(*l)) { + while (*l && ap_isspace(*l)) { ++l; } @@ -502,7 +502,7 @@ /* Nuke trailing whitespace */ char *endp = l + strlen(l) - 1; - while (endp > l && isspace(*endp)) { + while (endp > l && ap_isspace(*endp)) { *endp-- = '\0'; } 1.63 +8 -8 apache-1.3/src/modules/proxy/proxy_ftp.c Index: proxy_ftp.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_ftp.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -r1.62 -r1.63 --- proxy_ftp.c 1998/06/13 12:06:01 1.62 +++ proxy_ftp.c 1998/07/08 17:47:09 1.63 @@ -195,8 +195,8 @@ if (len == -1) return -1; /* check format */ - if (len < 5 || !isdigit(linebuff[0]) || !isdigit(linebuff[1]) || - !isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] != '-')) + if (len < 5 || !ap_isdigit(linebuff[0]) || !ap_isdigit(linebuff[1]) || + !ap_isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] != '-')) status = 0; else status = 100 * linebuff[0] + 10 * linebuff[1] + linebuff[2] - 111 * '0'; @@ -236,8 +236,8 @@ len = ap_bgets(linebuff, sizeof linebuff, f); if (len == -1) return -1; - if (len < 5 || !isdigit(linebuff[0]) || !isdigit(linebuff[1]) || - !isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] != '-')) + if (len < 5 || !ap_isdigit(linebuff[0]) || !ap_isdigit(linebuff[1]) || + !ap_isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] != '-')) status = 0; else status = 100 * linebuff[0] + 10 * linebuff[1] + linebuff[2] - 111 * '0'; @@ -376,8 +376,8 @@ ap_cpystrn(buf, buf2, sizeof(buf)); n = strlen(buf); } - else if (buf[0] == 'd' || buf[0] == '-' || buf[0] == 'l' || isdigit(buf[0])) { - if (isdigit(buf[0])) { /* handle DOS dir */ + else if (buf[0] == 'd' || buf[0] == '-' || buf[0] == 'l' || ap_isdigit(buf[0])) { + if (ap_isdigit(buf[0])) { /* handle DOS dir */ searchptr = strchr(buf, '<'); if (searchptr != NULL) *searchptr = '['; @@ -543,7 +543,7 @@ strp = strchr(host, ':'); if (strp != NULL) { *(strp++) = '\0'; - if (isdigit(*strp)) + if (ap_isdigit(*strp)) port = atoi(strp); } @@ -933,7 +933,7 @@ len = 0; } else if (i == 213) { /* Size command ok */ - for (j = 0; j < resplen && isdigit(resp[j]); j++) + for (j = 0; j < resplen && ap_isdigit(resp[j]); j++) ; resp[j] = '\0'; if (resp[0] != '\0') 1.52 +3 -3 apache-1.3/src/modules/proxy/proxy_http.c Index: proxy_http.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_http.c,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- proxy_http.c 1998/06/27 18:09:31 1.51 +++ proxy_http.c 1998/07/08 17:47:10 1.52 @@ -145,9 +145,9 @@ while (*next) { name = next; - while (*next && !isspace(*next) && (*next != ',')) + while (*next && !ap_isspace(*next) && (*next != ',')) ++next; - while (*next && (isspace(*next) || (*next == ','))) { + while (*next && (ap_isspace(*next) || (*next == ','))) { *next = '\0'; ++next; } @@ -219,7 +219,7 @@ strp2 = strchr(desthost, ':'); if (strp2 != NULL) { *(strp2++) = '\0'; - if (isdigit(*strp2)) { + if (ap_isdigit(*strp2)) { destport = atoi(strp2); destportstr = strp2; } 1.64 +16 -16 apache-1.3/src/modules/proxy/proxy_util.c Index: proxy_util.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/proxy/proxy_util.c,v retrieving revision 1.63 retrieving revision 1.64 diff -u -r1.63 -r1.64 --- proxy_util.c 1998/06/13 15:23:01 1.63 +++ proxy_util.c 1998/07/08 17:47:10 1.64 @@ -75,18 +75,18 @@ #ifndef CHARSET_EBCDIC ch = x[0]; - if (isdigit(ch)) + if (ap_isdigit(ch)) i = ch - '0'; - else if (isupper(ch)) + else if (ap_isupper(ch)) i = ch - ('A' - 10); else i = ch - ('a' - 10); i <<= 4; ch = x[1]; - if (isdigit(ch)) + if (ap_isdigit(ch)) i += ch - '0'; - else if (isupper(ch)) + else if (ap_isupper(ch)) i += ch - ('A' - 10); else i += ch - ('a' - 10); @@ -188,7 +188,7 @@ } } /* recode it, if necessary */ - if (!isalnum(ch) && !strchr(allowed, ch)) { + if (!ap_isalnum(ch) && !strchr(allowed, ch)) { ap_proxy_c2hex(ch, &y[j]); j += 2; } @@ -259,7 +259,7 @@ *(strp++) = '\0'; for (i = 0; strp[i] != '\0'; i++) - if (!isdigit(strp[i])) + if (!ap_isdigit(strp[i])) break; if (i == 0 || strp[i] != '\0') @@ -273,7 +273,7 @@ return "Missing host in URL"; /* check hostname syntax */ for (i = 0; host[i] != '\0'; i++) - if (!isdigit(host[i]) && host[i] != '.') + if (!ap_isdigit(host[i]) && host[i] != '.') break; /* must be an IP address */ #ifdef WIN32 @@ -607,12 +607,12 @@ i = p - list; do p++; - while (isspace(*p)); + while (ap_isspace(*p)); } else i = strlen(list); - while (i > 0 && isspace(list[i - 1])) + while (i > 0 && ap_isspace(list[i - 1])) i--; if (i == len && strncasecmp(list, val, len) == 0) return 1; @@ -735,9 +735,9 @@ for (i = 0, j = 0; i < 8; i++) { ch = x[i]; j <<= 4; - if (isdigit(ch)) + if (ap_isdigit(ch)) j |= ch - '0'; - else if (isupper(ch)) + else if (ap_isupper(ch)) j |= ch - ('A' - 10); else j |= ch - ('a' - 10); @@ -803,7 +803,7 @@ static APACHE_TLS char *charpbuf[2]; for (i = 0; host[i] != '\0'; i++) - if (!isdigit(host[i]) && host[i] != '.') + if (!ap_isdigit(host[i]) && host[i] != '.') break; if (host[i] != '\0') { @@ -883,7 +883,7 @@ if (*addr == '/' && quads > 0) /* netmask starts here. */ break; - if (!isdigit(*addr)) + if (!ap_isdigit(*addr)) return 0; /* no digit at start of quad */ ip_addr[quads] = strtol(addr, &tmp, 0); @@ -905,7 +905,7 @@ for (This->addr.s_addr = 0, i = 0; i < quads; ++i) This->addr.s_addr |= htonl(ip_addr[i] << (24 - 8 * i)); - if (addr[0] == '/' && isdigit(addr[1])) { /* net mask follows: */ + if (addr[0] == '/' && ap_isdigit(addr[1])) { /* net mask follows: */ char *tmp; ++addr; @@ -1048,7 +1048,7 @@ return 0; /* rfc1035 says DNS names must consist of "[-a-zA-Z0-9]" and '.' */ - for (i = 0; isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i) + for (i = 0; ap_isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i) continue; #if 0 @@ -1102,7 +1102,7 @@ return 0; /* rfc1035 says DNS names must consist of "[-a-zA-Z0-9]" and '.' */ - for (i = 0; isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i); + for (i = 0; ap_isalnum(addr[i]) || addr[i] == '-' || addr[i] == '.'; ++i); #if 0 if (addr[i] == ':') { 1.36 +4 -4 apache-1.3/src/modules/standard/mod_access.c Index: mod_access.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_access.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- mod_access.c 1998/04/19 19:19:38 1.35 +++ mod_access.c 1998/07/08 17:47:12 1.36 @@ -138,7 +138,7 @@ static int is_ip(const char *host) { - while ((*host == '.') || isdigit(*host)) + while ((*host == '.') || ap_isdigit(*host)) host++; return (*host == '\0'); } @@ -204,7 +204,7 @@ a->x.ip.mask = mask; } - else if (isdigit(*where) && is_ip(where)) { + else if (ap_isdigit(*where) && is_ip(where)) { /* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */ int shift; char *t; @@ -218,11 +218,11 @@ shift = 24; while (*s) { t = s; - if (!isdigit(*t)) { + if (!ap_isdigit(*t)) { a->type = T_FAIL; return "invalid ip address"; } - while (isdigit(*t)) { + while (ap_isdigit(*t)) { ++t; } if (*t == '.') { 1.37 +1 -1 apache-1.3/src/modules/standard/mod_alias.c Index: mod_alias.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_alias.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- mod_alias.c 1998/05/04 02:38:43 1.36 +++ mod_alias.c 1998/07/08 17:47:13 1.37 @@ -177,7 +177,7 @@ status = HTTP_MOVED_TEMPORARILY; else if (!strcasecmp(arg1, "seeother")) status = HTTP_SEE_OTHER; - else if (isdigit(*arg1)) + else if (ap_isdigit(*arg1)) status = atoi(arg1); else { f = arg1; 1.86 +3 -3 apache-1.3/src/modules/standard/mod_autoindex.c Index: mod_autoindex.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_autoindex.c,v retrieving revision 1.85 retrieving revision 1.86 diff -u -r1.85 -r1.86 --- mod_autoindex.c 1998/07/07 04:54:04 1.85 +++ mod_autoindex.c 1998/07/08 17:47:14 1.86 @@ -696,7 +696,7 @@ } titlebuf[n] = '\0'; for (x = 0, p = 0; titlebuf[x]; x++) { - if (toupper(titlebuf[x]) == find[p]) { + if (ap_toupper(titlebuf[x]) == find[p]) { if (!find[++p]) { if ((p = ap_ind(&titlebuf[++x], '<')) != -1) { titlebuf[x + p] = '\0'; @@ -747,8 +747,8 @@ p->alt = NULL; p->desc = NULL; p->lm = -1; - p->key = toupper(keyid); - p->ascending = (toupper(direction) == D_ASCENDING); + p->key = ap_toupper(keyid); + p->ascending = (ap_toupper(direction) == D_ASCENDING); if (autoindex_opts & FANCY_INDEXING) { request_rec *rr = ap_sub_req_lookup_file(name, r); 1.32 +2 -2 apache-1.3/src/modules/standard/mod_cern_meta.c Index: mod_cern_meta.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_cern_meta.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -r1.31 -r1.32 --- mod_cern_meta.c 1998/06/13 15:23:08 1.31 +++ mod_cern_meta.c 1998/07/08 17:47:14 1.32 @@ -257,7 +257,7 @@ } *l++ = '\0'; - while (*l && isspace(*l)) + while (*l && ap_isspace(*l)) ++l; if (!strcasecmp(w, "Content-type")) { @@ -265,7 +265,7 @@ /* Nuke trailing whitespace */ char *endp = l + strlen(l) - 1; - while (endp > l && isspace(*endp)) + while (endp > l && ap_isspace(*endp)) *endp-- = '\0'; tmp = ap_pstrdup(r->pool, l); 1.36 +2 -2 apache-1.3/src/modules/standard/mod_digest.c Index: mod_digest.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_digest.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- mod_digest.c 1998/07/01 21:19:59 1.35 +++ mod_digest.c 1998/07/08 17:47:14 1.36 @@ -197,7 +197,7 @@ break; case D_VALUE: - if (isalnum(auth_line[0])) { + if (ap_isalnum(auth_line[0])) { value[vv] = auth_line[0]; vv++; } @@ -225,7 +225,7 @@ break; case D_KEY: - if (isalnum(auth_line[0])) { + if (ap_isalnum(auth_line[0])) { key[vk] = auth_line[0]; vk++; } 1.28 +1 -1 apache-1.3/src/modules/standard/mod_expires.c Index: mod_expires.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_expires.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -r1.27 -r1.28 --- mod_expires.c 1998/04/11 12:00:46 1.27 +++ mod_expires.c 1998/07/08 17:47:15 1.28 @@ -284,7 +284,7 @@ while (word[0]) { /* <num> */ - if (isdigit(word[0])) { + if (ap_isdigit(word[0])) { num = atoi(word); } else { 1.47 +8 -8 apache-1.3/src/modules/standard/mod_imap.c Index: mod_imap.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_imap.c,v retrieving revision 1.46 retrieving revision 1.47 diff -u -r1.46 -r1.47 --- mod_imap.c 1998/06/13 15:23:08 1.46 +++ mod_imap.c 1998/07/08 17:47:15 1.47 @@ -263,7 +263,7 @@ return (-1); /* in case we aren't passed anything */ } - while (*args && !isdigit(*args) && *args != ',') { + while (*args && !ap_isdigit(*args) && *args != ',') { args++; /* jump to the first digit, but not past a comma or end */ } @@ -295,7 +295,7 @@ start_of_y++; /* start looking at the character after the comma */ - while (*start_of_y && !isdigit(*start_of_y)) { + while (*start_of_y && !ap_isdigit(*start_of_y)) { start_of_y++; /* jump to the first digit, but not past the end */ } @@ -326,7 +326,7 @@ /* assume there's no quoted part */ *quoted_part = NULL; - while (isspace(*strp)) { + while (ap_isspace(*strp)) { strp++; /* go along string until non-whitespace */ } @@ -385,7 +385,7 @@ } string_pos_const = value; - while (isalpha(*string_pos_const)) { + while (ap_isalpha(*string_pos_const)) { string_pos_const++; /* go along the URL from the map until a non-letter */ } @@ -746,17 +746,17 @@ sscanf(string_pos, "%lf%*[, ]%lf", &pointarray[vertex][X], &pointarray[vertex][Y]) == 2) { /* Now skip what we just read... we can't use ANSIism %n */ - while (isspace(*string_pos)) { /* past whitespace */ + while (ap_isspace(*string_pos)) { /* past whitespace */ string_pos++; } - while (isdigit(*string_pos)) { /* and the 1st number */ + while (ap_isdigit(*string_pos)) { /* and the 1st number */ string_pos++; } string_pos++; /* skip the ',' */ - while (isspace(*string_pos)) { /* past any more whitespace */ + while (ap_isspace(*string_pos)) { /* past any more whitespace */ string_pos++; } - while (isdigit(*string_pos)) { /* 2nd number */ + while (ap_isdigit(*string_pos)) { /* 2nd number */ string_pos++; } vertex++; 1.98 +13 -13 apache-1.3/src/modules/standard/mod_include.c Index: mod_include.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_include.c,v retrieving revision 1.97 retrieving revision 1.98 diff -u -r1.97 -r1.98 --- mod_include.c 1998/07/01 01:37:29 1.97 +++ mod_include.c 1998/07/08 17:47:16 1.98 @@ -309,7 +309,7 @@ /* is it numeric ? */ if (s[1] == '#') { - for (j = 2, val = 0; j < i && isdigit(s[j]); j++) { + for (j = 2, val = 0; j < i && ap_isdigit(s[j]); j++) { val = val * 10 + s[j] - '0'; } s += i; @@ -362,7 +362,7 @@ do { /* skip whitespace */ GET_CHAR(in, c, NULL, p); - } while (isspace(c)); + } while (ap_isspace(c)); /* tags can't start with - */ if (c == '-') { @@ -370,7 +370,7 @@ if (c == '-') { do { GET_CHAR(in, c, NULL, p); - } while (isspace(c)); + } while (ap_isspace(c)); if (c == '>') { ap_cpystrn(tag, "done", tagbuf_len); return tag; @@ -385,17 +385,17 @@ *t = '\0'; return NULL; } - if (c == '=' || isspace(c)) { + if (c == '=' || ap_isspace(c)) { break; } - *(t++) = tolower(c); + *(t++) = ap_tolower(c); GET_CHAR(in, c, NULL, p); } *t++ = '\0'; tag_val = t; - while (isspace(c)) { + while (ap_isspace(c)) { GET_CHAR(in, c, NULL, p); /* space before = */ } if (c != '=') { @@ -405,7 +405,7 @@ do { GET_CHAR(in, c, NULL, p); /* space after = */ - } while (isspace(c)); + } while (ap_isspace(c)); /* we should allow a 'name' as a value */ @@ -450,7 +450,7 @@ /* skip initial whitespace */ while (1) { GET_CHAR(in, c, 1, p); - if (!isspace(c)) { + if (!ap_isspace(c)) { break; } } @@ -459,9 +459,9 @@ if (d - dest == len) { return 1; } - *d++ = tolower(c); + *d++ = ap_tolower(c); GET_CHAR(in, c, 1, p); - if (isspace(c)) { + if (ap_isspace(c)) { break; } } @@ -524,7 +524,7 @@ } else { start_of_var_name = in; - while (isalnum(*in) || *in == '_') { + while (ap_isalnum(*in) || *in == '_') { ++in; } end_of_var_name = in; @@ -1152,7 +1152,7 @@ return (char *) NULL; } while ((ch = *string++)) { - if (!isspace(ch)) { + if (!ap_isspace(ch)) { break; } } @@ -1241,7 +1241,7 @@ continue; } if (!qs) { - if (isspace(ch)) { + if (ap_isspace(ch)) { goto TOKEN_DONE; } switch (ch) { 1.65 +1 -1 apache-1.3/src/modules/standard/mod_log_config.c Index: mod_log_config.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_log_config.c,v retrieving revision 1.64 retrieving revision 1.65 diff -u -r1.64 -r1.65 --- mod_log_config.c 1998/06/23 07:25:32 1.64 +++ mod_log_config.c 1998/07/08 17:47:16 1.65 @@ -584,7 +584,7 @@ case '8': case '9': i = *s - '0'; - while (isdigit(*++s)) { + while (ap_isdigit(*++s)) { i = i * 10 + (*s) - '0'; } if (!it->conditions) { 1.44 +1 -1 apache-1.3/src/modules/standard/mod_mime.c Index: mod_mime.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_mime.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- mod_mime.c 1998/06/14 21:10:27 1.43 +++ mod_mime.c 1998/07/08 17:47:17 1.44 @@ -199,7 +199,7 @@ * equivalent to 27 in ASCII, and makes it work in EBCDIC. */ #define MIME_HASHSIZE ('z'-'a'+2) -#define hash(i) (isalpha(i) ? (tolower(i)) - 'a' : (MIME_HASHSIZE-1)) +#define hash(i) (ap_isalpha(i) ? (ap_tolower(i)) - 'a' : (MIME_HASHSIZE-1)) static table *hash_buckets[MIME_HASHSIZE]; 1.36 +29 -39 apache-1.3/src/modules/standard/mod_mime_magic.c Index: mod_mime_magic.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_mime_magic.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -r1.35 -r1.36 --- mod_mime_magic.c 1998/06/14 21:10:28 1.35 +++ mod_mime_magic.c 1998/07/08 17:47:17 1.36 @@ -721,7 +721,7 @@ frag = frag->next, cur_frag++) { /* loop through the characters in the fragment */ for (cur_pos = 0; frag->str[cur_pos]; cur_pos++) { - if (isspace(frag->str[cur_pos])) { + if (ap_isspace(frag->str[cur_pos])) { /* process whitespace actions for each state */ if (state == rsl_leading_space) { /* eat whitespace in this state */ @@ -923,8 +923,7 @@ magic_rsl_puts(r, MIME_BINARY_UNKNOWN); } -#define EATAB {while (isascii((unsigned char) *l) && \ - isspace((unsigned char) *l)) ++l;} +#define EATAB {while (ap_isspace((unsigned char) *l)) ++l;} /* * apprentice - load configuration from the magic file r @@ -967,7 +966,7 @@ /* skip leading whitespace */ ws_offset = 0; - while (line[ws_offset] && isspace(line[ws_offset])) { + while (line[ws_offset] && ap_isspace(line[ws_offset])) { ws_offset++; } @@ -1010,10 +1009,10 @@ ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": apprentice test"); for (m = conf->magic; m; m = m->next) { - if (isprint((((unsigned long) m) >> 24) & 255) && - isprint((((unsigned long) m) >> 16) & 255) && - isprint((((unsigned long) m) >> 8) & 255) && - isprint(((unsigned long) m) & 255)) { + if (ap_isprint((((unsigned long) m) >> 24) & 255) && + ap_isprint((((unsigned long) m) >> 16) & 255) && + ap_isprint((((unsigned long) m) >> 8) & 255) && + ap_isprint(((unsigned long) m) & 255)) { ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": apprentice: POINTER CLOBBERED! " "m=\"%c%c%c%c\" line=%d", @@ -1141,7 +1140,7 @@ s = l; if (*l == '+' || *l == '-') l++; - if (isdigit((unsigned char) *l)) { + if (ap_isdigit((unsigned char) *l)) { m->in.offset = strtol(l, &t, 0); if (*s == '-') m->in.offset = -m->in.offset; @@ -1156,7 +1155,7 @@ } - while (isascii((unsigned char) *l) && isdigit((unsigned char) *l)) + while (ap_isdigit((unsigned char) *l)) ++l; EATAB; @@ -1254,8 +1253,7 @@ } /* FALL THROUGH */ default: - if (*l == 'x' && isascii((unsigned char) l[1]) && - isspace((unsigned char) l[1])) { + if (*l == 'x' && ap_isspace((unsigned char) l[1])) { m->reln = *l; ++l; goto GetDesc; /* Bill The Cat */ @@ -1327,7 +1325,7 @@ register int val; while ((c = *s++) != '\0') { - if (isspace((unsigned char) c)) + if (ap_isspace((unsigned char) c)) break; if (p >= pmax) { ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, serv, @@ -1430,9 +1428,7 @@ /* Single hex char to int; -1 if not a hex char. */ static int hextoint(int c) { - if (!isascii((unsigned char) c)) - return -1; - if (isdigit((unsigned char) c)) + if (ap_isdigit((unsigned char) c)) return c - '0'; if ((c >= 'a') && (c <= 'f')) return c + 10 - 'a'; @@ -1575,10 +1571,10 @@ #if MIME_MAGIC_DEBUG for (m = conf->magic; m; m = m->next) { - if (isprint((((unsigned long) m) >> 24) & 255) && - isprint((((unsigned long) m) >> 16) & 255) && - isprint((((unsigned long) m) >> 8) & 255) && - isprint(((unsigned long) m) & 255)) { + if (ap_isprint((((unsigned long) m) >> 24) & 255) && + ap_isprint((((unsigned long) m) >> 16) & 255) && + ap_isprint((((unsigned long) m) >> 8) & 255) && + ap_isprint(((unsigned long) m) & 255)) { ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, r->server, MODNAME ": match: POINTER CLOBBERED! " "m=\"%c%c%c%c\"", @@ -1996,7 +1992,7 @@ static int ascmagic(request_rec *r, unsigned char *buf, int nbytes) { - int i, has_escapes = 0; + int has_escapes = 0; unsigned char *s; char nbuf[HOWMANY + 1]; /* one extra for terminating '\0' */ char *token; @@ -2013,16 +2009,15 @@ if (*buf == '.') { unsigned char *tp = buf + 1; - while (isascii(*tp) && isspace(*tp)) + while (ap_isspace(*tp)) ++tp; /* skip leading whitespace */ - if ((isascii(*tp) && (isalnum(*tp) || *tp == '\\') && - isascii(*(tp + 1)) && (isalnum(*(tp + 1)) || *tp == '"'))) { + if ((ap_isalnum(*tp) || *tp == '\\') && + (ap_isalnum(*(tp + 1)) || *tp == '"')) { magic_rsl_puts(r, "application/x-troff"); return 1; } } - if ((*buf == 'c' || *buf == 'C') && - isascii(*(buf + 1)) && isspace(*(buf + 1))) { + if ((*buf == 'c' || *buf == 'C') && ap_isspace(*(buf + 1))) { /* Fortran */ magic_rsl_puts(r, "text/plain"); return 1; @@ -2059,11 +2054,6 @@ return 1; } - for (i = 0; i < nbytes; i++) { - if (!isascii(*(buf + i))) - return 0; /* not all ascii */ - } - /* all else fails, but it is ascii... */ if (has_escapes) { /* text with escape sequences */ @@ -2277,7 +2267,7 @@ { register long value; - while (isspace(*where)) { /* Skip spaces */ + while (ap_isspace(*where)) { /* Skip spaces */ where++; if (--digs <= 0) return -1; /* All blank field */ @@ -2288,7 +2278,7 @@ --digs; } - if (digs > 0 && *where && !isspace(*where)) + if (digs > 0 && *where && !ap_isspace(*where)) return -1; /* Ended on non-space/nul */ return value; @@ -2317,10 +2307,10 @@ /* check for recognized revision suffix */ suffix_pos = strlen(r->filename) - 1; - if (!isdigit(r->filename[suffix_pos])) { + if (!ap_isdigit(r->filename[suffix_pos])) { return 0; } - while (suffix_pos >= 0 && isdigit(r->filename[suffix_pos])) + while (suffix_pos >= 0 && ap_isdigit(r->filename[suffix_pos])) suffix_pos--; if (suffix_pos < 0 || r->filename[suffix_pos] != '@') { return 0; @@ -2388,10 +2378,10 @@ ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": magic_init 1 test"); for (m = conf->magic; m; m = m->next) { - if (isprint((((unsigned long) m) >> 24) & 255) && - isprint((((unsigned long) m) >> 16) & 255) && - isprint((((unsigned long) m) >> 8) & 255) && - isprint(((unsigned long) m) & 255)) { + if (ap_isprint((((unsigned long) m) >> 24) & 255) && + ap_isprint((((unsigned long) m) >> 16) & 255) && + ap_isprint((((unsigned long) m) >> 8) & 255) && + ap_isprint(((unsigned long) m) & 255)) { ap_log_error(APLOG_MARK, APLOG_NOERRNO | APLOG_DEBUG, s, MODNAME ": magic_init 1: POINTER CLOBBERED! " "m=\"%c%c%c%c\" line=%d", 1.83 +9 -9 apache-1.3/src/modules/standard/mod_negotiation.c Index: mod_negotiation.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_negotiation.c,v retrieving revision 1.82 retrieving revision 1.83 diff -u -r1.82 -r1.83 --- mod_negotiation.c 1998/06/14 21:10:28 1.82 +++ mod_negotiation.c 1998/07/08 17:47:18 1.83 @@ -346,8 +346,8 @@ /* Look for 'var = value' --- and make sure the var is in lcase. */ - for (cp = parm; (*cp && !isspace(*cp) && *cp != '='); ++cp) { - *cp = tolower(*cp); + for (cp = parm; (*cp && !ap_isspace(*cp) && *cp != '='); ++cp) { + *cp = ap_tolower(*cp); } if (!*cp) { @@ -355,7 +355,7 @@ } *cp++ = '\0'; /* Delimit var */ - while (*cp && (isspace(*cp) || *cp == '=')) { + while (*cp && (ap_isspace(*cp) || *cp == '=')) { ++cp; } @@ -366,7 +366,7 @@ end++); } else { - for (end = cp; (*end && !isspace(*end)); end++); + for (end = cp; (*end && !ap_isspace(*end)); end++); } if (*end) { *end = '\0'; /* strip ending quote or return */ @@ -583,7 +583,7 @@ /* If blank, just return it --- this ends information on this variant */ - for (cp = buffer; (*cp && isspace(*cp)); ++cp) { + for (cp = buffer; (*cp && ap_isspace(*cp)); ++cp) { continue; } @@ -604,13 +604,13 @@ continue; } } - else if (isspace(c)) { + else if (ap_isspace(c)) { /* Leading whitespace. POSSIBLE continuation line * Also, possibly blank --- if so, we ungetc() the final newline * so that we will pick up the blank line the next time 'round. */ - while (c != EOF && c != '\n' && isspace(c)) { + while (c != EOF && c != '\n' && ap_isspace(c)) { c = getc(map); } @@ -677,7 +677,7 @@ char *cp = header; for ( ; *cp && *cp != ':' ; ++cp) { - *cp = tolower(*cp); + *cp = ap_tolower(*cp); } if (!*cp) { @@ -688,7 +688,7 @@ do { ++cp; - } while (*cp && isspace(*cp)); + } while (*cp && ap_isspace(*cp)); if (!*cp) { ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r->server, 1.121 +3 -3 apache-1.3/src/modules/standard/mod_rewrite.c Index: mod_rewrite.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_rewrite.c,v retrieving revision 1.120 retrieving revision 1.121 diff -u -r1.120 -r1.121 --- mod_rewrite.c 1998/07/01 21:19:59 1.120 +++ mod_rewrite.c 1998/07/08 17:47:18 1.121 @@ -850,7 +850,7 @@ else if (strcasecmp(val, "seeother") == 0) { status = HTTP_SEE_OTHER; } - else if (isdigit(*val)) { + else if (ap_isdigit(*val)) { status = atoi(val); } if (!is_HTTP_REDIRECT(status)) { @@ -2931,7 +2931,7 @@ for (cp = value = ap_pstrdup(r->pool, key); cp != NULL && *cp != '\0'; cp++) { - *cp = toupper(*cp); + *cp = ap_toupper(*cp); } return value; } @@ -2942,7 +2942,7 @@ for (cp = value = ap_pstrdup(r->pool, key); cp != NULL && *cp != '\0'; cp++) { - *cp = tolower(*cp); + *cp = ap_tolower(*cp); } return value; } 1.21 +3 -3 apache-1.3/src/modules/standard/mod_speling.c Index: mod_speling.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_speling.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -r1.20 -r1.21 --- mod_speling.c 1998/06/13 15:23:12 1.20 +++ mod_speling.c 1998/07/08 17:47:18 1.21 @@ -156,13 +156,13 @@ static sp_reason spdist(const char *s, const char *t) { - for (; tolower(*s) == tolower(*t); t++, s++) + for (; ap_tolower(*s) == ap_tolower(*t); t++, s++) if (*t == '\0') return SP_MISCAPITALIZED; /* exact match (sans case) */ if (*s) { if (*t) { - if (s[1] && t[1] && tolower(*s) == tolower(t[1]) && - tolower(*t) == tolower(s[1]) && strcasecmp(s + 2, t + 2) == 0) + if (s[1] && t[1] && ap_tolower(*s) == ap_tolower(t[1]) && + ap_tolower(*t) == ap_tolower(s[1]) && strcasecmp(s + 2, t + 2) == 0) return SP_TRANSPOSITION; /* transposition */ if (strcasecmp(s + 1, t + 1) == 0) return SP_SIMPLETYPO; /* 1 char mismatch */ 1.37 +2 -2 apache-1.3/src/modules/standard/mod_usertrack.c Index: mod_usertrack.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/modules/standard/mod_usertrack.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -r1.36 -r1.37 --- mod_usertrack.c 1998/06/13 15:23:12 1.36 +++ mod_usertrack.c 1998/07/08 17:47:19 1.37 @@ -257,7 +257,7 @@ char *word; /* The simple case first - all numbers (we assume) */ - if (isdigit(arg[0]) && isdigit(arg[strlen(arg) - 1])) { + if (ap_isdigit(arg[0]) && ap_isdigit(arg[strlen(arg) - 1])) { cls->expires = atol(arg); return NULL; } @@ -276,7 +276,7 @@ /* {<num> <type>}* */ while (word[0]) { /* <num> */ - if (isdigit(word[0])) + if (ap_isdigit(word[0])) num = atoi(word); else return "bad expires code, numeric value expected."; 1.3 +1 -1 apache-1.3/src/os/bs2000/bs2login.c Index: bs2login.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/bs2000/bs2login.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- bs2login.c 1998/05/04 22:18:24 1.2 +++ bs2login.c 1998/07/08 17:47:24 1.3 @@ -118,7 +118,7 @@ ap_snprintf(lcl_data.username, sizeof lcl_data.username, "%s", user_name); for (cp = lcl_data.username; *cp; ++cp) { - *cp = toupper(*cp); + *cp = ap_toupper(*cp); } if (bs2000_authfile == NULL) { 1.13 +2 -2 apache-1.3/src/os/win32/mod_isapi.c Index: mod_isapi.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/mod_isapi.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- mod_isapi.c 1998/06/13 15:23:18 1.12 +++ mod_isapi.c 1998/07/08 17:47:24 1.13 @@ -459,7 +459,7 @@ } *value++ = '\0'; - while (*value && isspace(*value)) ++value; + while (*value && ap_isspace(*value)) ++value; /* Check all the special-case headers. Similar to what * scan_script_header() does (see that function for @@ -471,7 +471,7 @@ /* Nuke trailing whitespace */ char *endp = value + strlen(value) - 1; - while (endp > value && isspace(*endp)) *endp-- = '\0'; + while (endp > value && ap_isspace(*endp)) *endp-- = '\0'; tmp = ap_pstrdup (r->pool, value); ap_str_tolower(tmp); 1.20 +2 -2 apache-1.3/src/os/win32/util_win32.c Index: util_win32.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/os/win32/util_win32.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- util_win32.c 1998/06/29 23:14:19 1.19 +++ util_win32.c 1998/07/08 17:47:25 1.20 @@ -43,7 +43,7 @@ ap_assert(strlen(buf) < nCanon); strcpy(szCanon, buf); if(szCanon[0] != '\\') { /* a \ at the start means it is UNC, otherwise it is x: */ - ap_assert(isalpha(szCanon[0])); + ap_assert(ap_isalpha(szCanon[0])); ap_assert(szCanon[1] == ':'); szCanon[2] = '/'; } @@ -130,7 +130,7 @@ sub_canonical_filename(buf, sizeof buf, b2); - buf[0]=tolower(buf[0]); + buf[0]=ap_tolower(buf[0]); ap_assert(strlen(buf)+nSlashes < sizeof buf); while(nSlashes--) 1.4 +1 -1 apache-1.3/src/regex/debug.c Index: debug.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/regex/debug.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- debug.c 1998/02/04 18:18:53 1.3 +++ debug.c 1998/07/08 17:47:26 1.4 @@ -234,7 +234,7 @@ { static char buf[10]; - if (isprint(ch) || ch == ' ') + if (ap_isprint(ch) || ch == ' ') sprintf(buf, "%c", ch); else sprintf(buf, "\\%o", ch); 1.3 +1 -1 apache-1.3/src/regex/engine.c Index: engine.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/regex/engine.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- engine.c 1997/02/17 04:52:40 1.2 +++ engine.c 1998/07/08 17:47:26 1.3 @@ -999,7 +999,7 @@ { static char pbuf[10]; - if (isprint(ch) || ch == ' ') + if (ap_isprint(ch) || ch == ' ') sprintf(pbuf, "%c", ch); else sprintf(pbuf, "\\%o", ch); 1.6 +14 -14 apache-1.3/src/regex/regcomp.c Index: regcomp.c =================================================================== RCS file: /export/home/cvs/apache-1.3/src/regex/regcomp.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- regcomp.c 1998/02/04 18:18:53 1.5 +++ regcomp.c 1998/07/08 17:47:27 1.6 @@ -310,7 +310,7 @@ ordinary(p, c); break; case '{': /* okay as ordinary except if digit follows */ - REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT); + REQUIRE(!MORE() || !ap_isdigit(PEEK()), REG_BADRPT); /* FALLTHROUGH */ default: ordinary(p, c); @@ -322,7 +322,7 @@ c = PEEK(); /* we call { a repetition if followed by a digit */ if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) )) + (c == '{' && MORE2() && ap_isdigit(PEEK2())) )) return; /* no repetition, we're done */ NEXT1(); @@ -351,7 +351,7 @@ case '{': count = p_count(p); if (EAT(',')) { - if (isdigit(PEEK())) { + if (ap_isdigit(PEEK())) { count2 = p_count(p); REQUIRE(count <= count2, REG_BADBR); } else /* single number with comma */ @@ -372,7 +372,7 @@ return; c = PEEK(); if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit(PEEK2())) ) ) + (c == '{' && MORE2() && ap_isdigit(PEEK2())) ) ) return; SETERROR(REG_BADRPT); } @@ -529,7 +529,7 @@ } else if (EATTWO('\\', '{')) { count = p_count(p); if (EAT(',')) { - if (MORE() && isdigit(PEEK())) { + if (MORE() && ap_isdigit(PEEK())) { count2 = p_count(p); REQUIRE(count <= count2, REG_BADBR); } else /* single number with comma */ @@ -560,7 +560,7 @@ register int count = 0; register int ndigits = 0; - while (MORE() && isdigit(PEEK()) && count <= DUPMAX) { + while (MORE() && ap_isdigit(PEEK()) && count <= DUPMAX) { count = count*10 + (GETNEXT() - '0'); ndigits++; } @@ -615,7 +615,7 @@ register int ci; for (i = p->g->csetsize - 1; i >= 0; i--) - if (CHIN(cs, i) && isalpha(i)) { + if (CHIN(cs, i) && ap_isalpha(i)) { ci = othercase(i); if (ci != i) CHadd(cs, ci); @@ -727,7 +727,7 @@ register char *u; register char c; - while (MORE() && isalpha(PEEK())) + while (MORE() && ap_isalpha(PEEK())) NEXT1(); len = p->next - sp; for (cp = cclasses; cp->name != NULL; cp++) @@ -820,11 +820,11 @@ othercase(ch) int ch; { - assert(isalpha(ch)); - if (isupper(ch)) - return(tolower(ch)); - else if (islower(ch)) - return(toupper(ch)); + assert(ap_isalpha(ch)); + if (ap_isupper(ch)) + return(ap_tolower(ch)); + else if (ap_islower(ch)) + return(ap_toupper(ch)); else /* peculiar, but could happen */ return(ch); } @@ -867,7 +867,7 @@ { register cat_t *cap = p->g->categories; - if ((p->g->cflags®_ICASE) && isalpha(ch) && othercase(ch) != ch) + if ((p->g->cflags®_ICASE) && ap_isalpha(ch) && othercase(ch) != ch) bothcases(p, ch); else { EMIT(OCHAR, (unsigned char)ch); 1.5 +1 -1 apache-1.3/src/regex/regex2.h Index: regex2.h =================================================================== RCS file: /export/home/cvs/apache-1.3/src/regex/regex2.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- regex2.h 1997/07/16 00:41:25 1.4 +++ regex2.h 1998/07/08 17:47:27 1.5 @@ -135,4 +135,4 @@ /* misc utilities */ #define OUT (CHAR_MAX+1) /* a non-character value */ -#define ISWORD(c) (isalnum(c) || (c) == '_') +#define ISWORD(c) (ap_isalnum(c) || (c) == '_')