From: Greg Stein Date: Tue, 17 Jun 2003 17:39:10 +0000 (+0000) Subject: Following the previous commit to the header file, adjust the actual X-Git-Tag: 2.0.47~58 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c1f2b802fee7d201134269828c6d702f4777e80d;p=thirdparty%2Fapache%2Fhttpd.git Following the previous commit to the header file, adjust the actual parameters of ap_strcmp_match() and ap_strcasecmp_match() to use 'expected' rather than 'exp' to avoid shadowing the global exp() function. Submitted by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@100287 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/util.c b/server/util.c index eaac9b80dd4..251eacd6a77 100644 --- a/server/util.c +++ b/server/util.c @@ -213,50 +213,50 @@ AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt, * Based loosely on sections of wildmat.c by Rich Salz * Hmmm... shouldn't this really go component by component? */ -AP_DECLARE(int) ap_strcmp_match(const char *str, const char *exp) +AP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected) { int x, y; - for (x = 0, y = 0; exp[y]; ++y, ++x) { - if ((!str[x]) && (exp[y] != '*')) + for (x = 0, y = 0; expected[y]; ++y, ++x) { + if ((!str[x]) && (expected[y] != '*')) return -1; - if (exp[y] == '*') { - while (exp[++y] == '*'); - if (!exp[y]) + if (expected[y] == '*') { + while (expected[++y] == '*'); + if (!expected[y]) return 0; while (str[x]) { int ret; - if ((ret = ap_strcmp_match(&str[x++], &exp[y])) != 1) + if ((ret = ap_strcmp_match(&str[x++], &expected[y])) != 1) return ret; } return -1; } - else if ((exp[y] != '?') && (str[x] != exp[y])) + else if ((expected[y] != '?') && (str[x] != expected[y])) return 1; } return (str[x] != '\0'); } -AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *exp) +AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected) { int x, y; - for (x = 0, y = 0; exp[y]; ++y, ++x) { - if (!str[x] && exp[y] != '*') + for (x = 0, y = 0; expected[y]; ++y, ++x) { + if (!str[x] && expected[y] != '*') return -1; - if (exp[y] == '*') { - while (exp[++y] == '*'); - if (!exp[y]) + if (expected[y] == '*') { + while (expected[++y] == '*'); + if (!expected[y]) return 0; while (str[x]) { int ret; - if ((ret = ap_strcasecmp_match(&str[x++], &exp[y])) != 1) + if ((ret = ap_strcasecmp_match(&str[x++], &expected[y])) != 1) return ret; } return -1; } - else if (exp[y] != '?' - && apr_tolower(str[x]) != apr_tolower(exp[y])) + else if (expected[y] != '?' + && apr_tolower(str[x]) != apr_tolower(expected[y])) return 1; } return (str[x] != '\0');