While at it, same treatment for its mother ap_strcmp_match().
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@
1826313 13f79535-47bb-0310-9956-
ffa450edef68
apr_size_t x, y;
for (x = 0, y = 0; expected[y]; ++y, ++x) {
- int backref = (expected[y] == '$' && apr_isdigit(expected[y + 1]));
- if (!str[x] && !backref)
- return -1;
- if (backref) {
+ if (expected[y] == '$' && apr_isdigit(expected[y + 1])) {
do {
y += 2;
} while (expected[y] == '$' && apr_isdigit(expected[y + 1]));
}
return -1;
}
- else if (expected[y] == '\\') {
+ else if (!str[x]) {
+ return -1;
+ }
+ else if (expected[y] == '\\' && !expected[++y]) {
/* NUL is an invalid char! */
- if (!expected[++y])
- return -2;
+ return -2;
}
if (str[x] != expected[y])
return 1;
int x, y;
for (x = 0, y = 0; expected[y]; ++y, ++x) {
- if ((!str[x]) && (expected[y] != '*'))
- return -1;
if (expected[y] == '*') {
while (expected[++y] == '*');
if (!expected[y])
}
return -1;
}
+ else if (!str[x])
+ return -1;
else if ((expected[y] != '?') && (str[x] != expected[y]))
return 1;
}