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

Function ap_strcmp_match

server/util.c:175–197  ·  view source on GitHub ↗

Match = 0, NoMatch = 1, Abort = -1 * Based loosely on sections of wildmat.c by Rich Salz * Hmmm... shouldn't this really go component by component? */

Source from the content-addressed store, hash-verified

173 * Hmmm... shouldn't this really go component by component?
174 */
175AP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected)
176{
177 apr_size_t x, y;
178
179 for (x = 0, y = 0; expected[y]; ++y, ++x) {
180 if (expected[y] == '*') {
181 while (expected[++y] == '*');
182 if (!expected[y])
183 return 0;
184 while (str[x]) {
185 int ret;
186 if ((ret = ap_strcmp_match(&str[x++], &expected[y])) != 1)
187 return ret;
188 }
189 return -1;
190 }
191 else if (!str[x])
192 return -1;
193 else if ((expected[y] != '?') && (str[x] != expected[y]))
194 return 1;
195 }
196 return (str[x] != '\0');
197}
198
199AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected)
200{

Callers 5

file_cache_handlerFunction · 0.85
ssl_log_annotationFunction · 0.85
find_itemFunction · 0.85
ignore_entryFunction · 0.85
lua_ap_strcmp_matchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected