MCPcopy Create free account
hub / github.com/apache/httpd / ap_strcasecmp_match

Function ap_strcasecmp_match

server/util.c:199–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected)
200{
201 apr_size_t x, y;
202
203 for (x = 0, y = 0; expected[y]; ++y, ++x) {
204 if (!str[x] && expected[y] != '*')
205 return -1;
206 if (expected[y] == '*') {
207 while (expected[++y] == '*');
208 if (!expected[y])
209 return 0;
210 while (str[x]) {
211 int ret;
212 if ((ret = ap_strcasecmp_match(&str[x++], &expected[y])) != 1)
213 return ret;
214 }
215 return -1;
216 }
217 else if (expected[y] != '?'
218 && apr_tolower(str[x]) != apr_tolower(expected[y]))
219 return 1;
220 }
221 return (str[x] != '\0');
222}
223
224/* We actually compare the canonical root to this root, (but we don't
225 * waste time checking the case), since every use of this function in

Callers 6

ssl_util_vhost_matchesFunction · 0.85
find_itemFunction · 0.85
ignore_entryFunction · 0.85
lua_ap_strcmp_matchFunction · 0.85
lua_ap_get_active_configFunction · 0.85
matches_aliasesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected