1
0
mirror of https://github.com/apache/httpd.git synced 2025-09-02 13:21:21 +03:00

Fix a couple of const warnings on Linux. This basically just defines

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
This commit is contained in:
Ryan Bloom
2000-06-24 19:31:42 +00:00
parent 02a2200fd8
commit 8b17259223
4 changed files with 17 additions and 3 deletions

View 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

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

View 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

View 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