summaryrefslogtreecommitdiffstats
path: root/server/util.c
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-03-09 10:36:18 +0100
committerYann Ylavic <ylavic@apache.org>2018-03-09 10:36:18 +0100
commit2077d6be0ab4dd30aa716d1ea7b5ad2a727b8d0d (patch)
tree43ddccf210e62256bcd4d40eb799edfeb5261dfd /server/util.c
parentFollow up to r1609680: simpler/faster ap_proxy_strcmp_ematch(). (diff)
downloadapache2-2077d6be0ab4dd30aa716d1ea7b5ad2a727b8d0d.tar.xz
apache2-2077d6be0ab4dd30aa716d1ea7b5ad2a727b8d0d.zip
Follow up to r1609680: further simplify/optimize ap_proxy_strcmp_ematch().
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
Diffstat (limited to 'server/util.c')
-rw-r--r--server/util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/util.c b/server/util.c
index d302764e34..5ec8f8e6e0 100644
--- a/server/util.c
+++ b/server/util.c
@@ -190,8 +190,6 @@ AP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected)
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])
@@ -203,6 +201,8 @@ AP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected)
}
return -1;
}
+ else if (!str[x])
+ return -1;
else if ((expected[y] != '?') && (str[x] != expected[y]))
return 1;
}