httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gst...@apache.org
Subject cvs commit: httpd-2.0/server util.c
Date Tue, 17 Jun 2003 17:38:16 GMT
gstein      2003/06/17 10:38:16

  Modified:    server   util.c
  Log:
  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>
  
  Revision  Changes    Path
  1.140     +17 -17    httpd-2.0/server/util.c
  
  Index: util.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/util.c,v
  retrieving revision 1.139
  retrieving revision 1.140
  diff -u -r1.139 -r1.140
  --- util.c	31 Mar 2003 04:45:57 -0000	1.139
  +++ util.c	17 Jun 2003 17:38:16 -0000	1.140
  @@ -213,50 +213,50 @@
    * 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');
  
  
  

Mime
View raw message