httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/experimental mod_filter.c
Date Sun, 17 Oct 2004 17:05:59 GMT
nd          2004/10/17 10:05:59

  Modified:    modules/experimental mod_filter.c
  Log:
  minor optimizations
  
  Revision  Changes    Path
  1.18      +10 -10    httpd-2.0/modules/experimental/mod_filter.c
  
  Index: mod_filter.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/experimental/mod_filter.c,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -u -r1.17 -r1.18
  --- mod_filter.c	17 Oct 2004 16:58:10 -0000	1.17
  +++ mod_filter.c	17 Oct 2004 17:05:59 -0000	1.18
  @@ -476,7 +476,7 @@
       else {
           provider = apr_palloc(cmd->pool, sizeof(ap_filter_provider_t));
   
  -        if (match[0] == '!') {
  +        if (*match == '!') {
               provider->not = 1;
               ++match;
           }
  @@ -484,22 +484,22 @@
               provider->not = 0;
           }
   
  -        switch (match[0]) {
  +        switch (*match++) {
           case '<':
               provider->match_type = INT_LT;
  -            provider->match.number = atoi(match+1);
  +            provider->match.number = atoi(match);
               break;
           case '>':
               provider->match_type = INT_GT;
  -            provider->match.number = atoi(match+1);
  +            provider->match.number = atoi(match);
               break;
           case '=':
               provider->match_type = INT_EQ;
  -            provider->match.number = atoi(match+1);
  +            provider->match.number = atoi(match);
               break;
           case '/':
               provider->match_type = REGEX_MATCH;
  -            rxend = ap_strchr_c(match+1, '/');
  +            rxend = ap_strchr_c(match, '/');
               if (!rxend) {
                     return "Bad regexp syntax";
               }
  @@ -511,8 +511,8 @@
               }
               provider->match.regex = ap_pregcomp(cmd->pool,
                                                   apr_pstrndup(cmd->pool,
  -                                                             match+1,
  -                                                             rxend-match-1),
  +                                                             match,
  +                                                             rxend-match),
                                                   flags);
               break;
           case '*':
  @@ -521,13 +521,13 @@
               break;
           case '$':
               provider->match_type = STRING_CONTAINS;
  -            str = apr_pstrdup(cmd->pool, match+1);
  +            str = apr_pstrdup(cmd->pool, match);
               ap_str_tolower(str);
               provider->match.string = str;
               break;
           default:
               provider->match_type = STRING_MATCH;
  -            provider->match.string = apr_pstrdup(cmd->pool, match);
  +            provider->match.string = apr_pstrdup(cmd->pool, match-1);
               break;
           }
           provider->frec = provider_frec;
  
  
  

Mime
View raw message