]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Remove a bunch of string functions from Apache. These are basically
authorRyan Bloom <rbb@apache.org>
Fri, 9 Jun 2000 21:19:52 +0000 (21:19 +0000)
committerRyan Bloom <rbb@apache.org>
Fri, 9 Jun 2000 21:19:52 +0000 (21:19 +0000)
standard string functions like strstr, strcasecmp, etc that Apache used
to define for platforms that don't have them.  These functions and the
feature tests have moved down to APR where they really belong.  In doing
this, I am also able to remove a bunch of tests from the Apache configure
process.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85487 13f79535-47bb-0310-9956-ffa450edef68

configure.in
include/httpd.h
os/win32/os.h
server/util.c

index 0bcb5e7fc672041b31c7d2eff169944d7bbf0cb5..643b8034829706e9cc967aec9d1a06ad7e1ec730 100644 (file)
@@ -100,10 +100,6 @@ dnl ## Check for library functions
 dnl See Comment #Spoon
 
 AC_CHECK_FUNCS( \
-strdup \
-strcasecmp \
-strncasecmp \
-strstr \
 initgroups \
 waitpid \
 memmove \
index 3831c3e2834e61c797cc65249f5ea6d2d5e99fd7..b06a4556ab9e7bf1ea16003aba2770457e86aa84 100644 (file)
@@ -969,14 +969,6 @@ API_EXPORT(char *) ap_pbase64encode(ap_pool_t *p, char *string);
 API_EXPORT(char *) ap_uudecode(ap_pool_t *p, const char *bufcoded);
 API_EXPORT(char *) ap_uuencode(ap_pool_t *p, char *string); 
 
-#ifndef HAVE_STRCASECMP
-int strcasecmp(const char *a, const char *b);
-#endif
-
-#ifndef HAVE_STRNCASECMP
-int strncasecmp(const char *a, const char *b, size_t n);
-#endif
-
 #include "pcreposix.h"
 
 API_EXPORT(regex_t *) ap_pregcomp(ap_pool_t *p, const char *pattern,
index d20914d32f1d76b72c8cef8107a3897e9884223b..a08ea5be0d1ce8a5b17ebb0dcb24cfe16bdc7c6d 100644 (file)
@@ -116,13 +116,6 @@ typedef int mode_t;
 typedef char * caddr_t;
 
 #define HAVE_MEMMOVE
-#define HAVE_STRCASECMP
-#define HAVE_STRNCASECMP
-#define HAVE_STRDUP
-#define HAVE_STRSTR
-
-#define strcasecmp(s1, s2) stricmp(s1, s2)
-#define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
 
 #define HAVE_SYS_STAT_H
 #define lstat(x, y) stat(x, y)
index 5c7e834aa862d9ace53ed0110e0f1063b1d4ace2..e6746d95e5b90ba2bec9261e841cd1864d89292e 100644 (file)
@@ -1689,91 +1689,6 @@ API_EXPORT(int) ap_is_url(const char *u)
     return (x ? 1 : 0);                /* If the first character is ':', it's broken, too */
 }
 
-#ifndef HAVE_STRDUP
-char *strdup(const char *str)
-{
-    char *sdup;
-
-    if (!(sdup = (char *) malloc(strlen(str) + 1))) {
-       ap_log_error(APLOG_MARK, APLOG_STARTUP | APLOG_NOERRNO, 0, NULL, "Ouch!  Out of memory in our strdup()!");
-       return NULL;
-    }
-    sdup = strcpy(sdup, str);
-
-    return sdup;
-}
-#endif
-
-/* The following two routines were donated for SVR4 by Andreas Vogel */
-#ifndef HAVE_STRCASECMP
-int strcasecmp(const char *a, const char *b)
-{
-    const char *p = a;
-    const char *q = b;
-    for (p = a, q = b; *p && *q; p++, q++) {
-       int diff = ap_tolower(*p) - ap_tolower(*q);
-       if (diff)
-           return diff;
-    }
-    if (*p)
-       return 1;               /* p was longer than q */
-    if (*q)
-       return -1;              /* p was shorter than q */
-    return 0;                  /* Exact match */
-}
-
-#endif
-
-#ifndef HAVE_STRNCASECMP
-int strncasecmp(const char *a, const char *b, size_t n)
-{
-    const char *p = a;
-    const char *q = b;
-
-    for (p = a, q = b; /*NOTHING */ ; p++, q++) {
-       int diff;
-       if (p == a + n)
-           return 0;           /*   Match up to n characters */
-       if (!(*p && *q))
-           return *p - *q;
-       diff = ap_tolower(*p) - ap_tolower(*q);
-       if (diff)
-           return diff;
-    }
-    /*NOTREACHED */
-}
-#endif
-
-/* The following routine was donated for UTS21 by dwd@bell-labs.com */
-#ifndef HAVE_STRSTR
-char *strstr(char *s1, char *s2)
-{
-    char *p1, *p2;
-    if (*s2 == '\0') {
-       /* an empty s2 */
-        return(s1);
-    }
-    while((s1 = strchr(s1, *s2)) != NULL) {
-       /* found first character of s2, see if the rest matches */
-        p1 = s1;
-        p2 = s2;
-        while (*++p1 == *++p2) {
-            if (*p1 == '\0') {
-                /* both strings ended together */
-                return(s1);
-            }
-        }
-        if (*p2 == '\0') {
-            /* second string ended, a match */
-            break;
-        }
-       /* didn't find a match here, try starting at next character in s1 */
-        s1++;
-    }
-    return(s1);
-}
-#endif
-
 #ifndef HAVE_INITGROUPS
 int initgroups(const char *name, gid_t basegid)
 {