]> granicus.if.org Git - apache/commitdiff
Fix a couple of const warnings on Linux. This basically just defines
authorRyan Bloom <rbb@apache.org>
Sat, 24 Jun 2000 19:31:42 +0000 (19:31 +0000)
committerRyan Bloom <rbb@apache.org>
Sat, 24 Jun 2000 19:31:42 +0000 (19:31 +0000)
ap_strstr and ap_strstr_c, which make sure that things are const when
they need to be.

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

include/httpd.h
modules/generators/mod_autoindex.c
modules/http/http_protocol.c
server/util_debug.c

index fd7aa83f37e49fe23a60b4ca986b668fa7e49111..837eaf5bf279eb2ccdf9a8e7571cd51696983821 100644 (file)
@@ -1035,11 +1035,15 @@ API_EXPORT(extern const char *) ap_psignature(const char *prefix, request_rec *r
 # define strchr(s, c)  ap_strchr(s,c)
 #undef strrchr
 # define strrchr(s, c)  ap_strrchr(s,c)
+#undef strstr
+# define strstr(s, c)  ap_strstr(s,c)
 
 char *ap_strchr(char *s, int c);
 const char *ap_strchr_c(const char *s, int c);
 char *ap_strrchr(char *s, int c);
 const char *ap_strrchr_c(const char *s, int c);
+char *ap_strstr(char *s, char *c);
+const char *ap_strstr_c(const char *s, const char *c);
 
 #else
 
@@ -1047,6 +1051,8 @@ const char *ap_strrchr_c(const char *s, int c);
 # define ap_strchr_c(s, c)     strchr(s, c)
 # define ap_strrchr(s, c)      strrchr(s, c)
 # define ap_strrchr_c(s, c)    strrchr(s, c)
+# define ap_strstr(s, c)       strstr(s, c)
+# define ap_strstr_c(s, c)     strstr(s, c)
 
 #endif
 
index 9442707fc0167bb95a25325b51652493acbbd6ce..5954c4b15f32d28d964ea495fee351a30891188a 100644 (file)
@@ -818,7 +818,7 @@ static char *find_desc(autoindex_config_rec *dcfg, request_rec *r)
            found = (ap_fnmatch(tuple->pattern, filename, MATCH_FLAGS) == 0);
        }
        else {
-           found = (strstr(filename, tuple->pattern) != NULL);
+           found = (ap_strstr_c(filename, tuple->pattern) != NULL);
        }
        if (found) {
            return tuple->description;
index c232323baddfacf1c5a4d1dc2855300c5be2c699..64515102659b701c23d248df413375a1472bf425 100644 (file)
@@ -610,7 +610,7 @@ API_EXPORT(int) ap_meets_conditions(request_rec *r)
                         return HTTP_NOT_MODIFIED;
                     }
                 }
-                else if (strstr(if_nonematch, etag)) {
+                else if (ap_strstr_c(if_nonematch, etag)) {
                     return HTTP_NOT_MODIFIED;
                 }
             }
@@ -1631,7 +1631,7 @@ static int use_range_x(request_rec *r)
     const char *ua;
     return (ap_table_get(r->headers_in, "Request-Range") ||
             ((ua = ap_table_get(r->headers_in, "User-Agent"))
-             && strstr(ua, "MSIE 3")));
+             && ap_strstr_c(ua, "MSIE 3")));
 }
 
 /* This routine is called by ap_table_do and merges all instances of
index 415fdcac8e98a03ec2276afcd94450399df8b6fa..0972832cfb72d73fe3ef81b9380e2670b0391dd8 100644 (file)
@@ -75,4 +75,12 @@ char *ap_strrchr(char *s, int c)
 const char *ap_strrchr_c(const char *s, int c)
 { return strrchr(s,c); }
 
+#undef strstr
+
+char *ap_strstr(char *s, char *c)
+{ return strstr(s,c); }
+
+const char *ap_strstr_c(const char *s, const char *c)
+{ return strstr(s,c); }
+
 #endif