Skip to content

Commit bb5ca04

Browse files
committed
Following the previous commit, 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 <justin@erenkrantz.com> git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100286 13f79535-47bb-0310-9956-ffa450edef68
1 parent ec72e29 commit bb5ca04

1 file changed

Lines changed: 17 additions & 17 deletions

File tree

server/util.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -213,50 +213,50 @@ AP_DECLARE(char *) ap_ht_time(apr_pool_t *p, apr_time_t t, const char *fmt,
213213
* Based loosely on sections of wildmat.c by Rich Salz
214214
* Hmmm... shouldn't this really go component by component?
215215
*/
216-
AP_DECLARE(int) ap_strcmp_match(const char *str, const char *exp)
216+
AP_DECLARE(int) ap_strcmp_match(const char *str, const char *expected)
217217
{
218218
int x, y;
219219

220-
for (x = 0, y = 0; exp[y]; ++y, ++x) {
221-
if ((!str[x]) && (exp[y] != '*'))
220+
for (x = 0, y = 0; expected[y]; ++y, ++x) {
221+
if ((!str[x]) && (expected[y] != '*'))
222222
return -1;
223-
if (exp[y] == '*') {
224-
while (exp[++y] == '*');
225-
if (!exp[y])
223+
if (expected[y] == '*') {
224+
while (expected[++y] == '*');
225+
if (!expected[y])
226226
return 0;
227227
while (str[x]) {
228228
int ret;
229-
if ((ret = ap_strcmp_match(&str[x++], &exp[y])) != 1)
229+
if ((ret = ap_strcmp_match(&str[x++], &expected[y])) != 1)
230230
return ret;
231231
}
232232
return -1;
233233
}
234-
else if ((exp[y] != '?') && (str[x] != exp[y]))
234+
else if ((expected[y] != '?') && (str[x] != expected[y]))
235235
return 1;
236236
}
237237
return (str[x] != '\0');
238238
}
239239

240-
AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *exp)
240+
AP_DECLARE(int) ap_strcasecmp_match(const char *str, const char *expected)
241241
{
242242
int x, y;
243243

244-
for (x = 0, y = 0; exp[y]; ++y, ++x) {
245-
if (!str[x] && exp[y] != '*')
244+
for (x = 0, y = 0; expected[y]; ++y, ++x) {
245+
if (!str[x] && expected[y] != '*')
246246
return -1;
247-
if (exp[y] == '*') {
248-
while (exp[++y] == '*');
249-
if (!exp[y])
247+
if (expected[y] == '*') {
248+
while (expected[++y] == '*');
249+
if (!expected[y])
250250
return 0;
251251
while (str[x]) {
252252
int ret;
253-
if ((ret = ap_strcasecmp_match(&str[x++], &exp[y])) != 1)
253+
if ((ret = ap_strcasecmp_match(&str[x++], &expected[y])) != 1)
254254
return ret;
255255
}
256256
return -1;
257257
}
258-
else if (exp[y] != '?'
259-
&& apr_tolower(str[x]) != apr_tolower(exp[y]))
258+
else if (expected[y] != '?'
259+
&& apr_tolower(str[x]) != apr_tolower(expected[y]))
260260
return 1;
261261
}
262262
return (str[x] != '\0');

0 commit comments

Comments
 (0)