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/filters mod_include.c
Date Wed, 27 Aug 2003 20:26:28 GMT
nd          2003/08/27 13:26:28

  Modified:    modules/filters mod_include.c
  Log:
  hrm. reverting my last commit. TOKEN_GROUP is a protection against many
  invalid expressions. Checking these all manually would take a lot more
  cycles than it'd save. Sorry.
  
  Revision  Changes    Path
  1.278     +27 -19    httpd-2.0/modules/filters/mod_include.c
  
  Index: mod_include.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/filters/mod_include.c,v
  retrieving revision 1.277
  retrieving revision 1.278
  diff -u -r1.277 -r1.278
  --- mod_include.c	27 Aug 2003 19:32:35 -0000	1.277
  +++ mod_include.c	27 Aug 2003 20:26:28 -0000	1.278
  @@ -126,6 +126,7 @@
       TOKEN_NE,
       TOKEN_RBRACE,
       TOKEN_LBRACE,
  +    TOKEN_GROUP,
       TOKEN_GE,
       TOKEN_LE,
       TOKEN_GT,
  @@ -335,6 +336,7 @@
               continue;
   
           case TOKEN_NOT:
  +        case TOKEN_GROUP:
           case TOKEN_RBRACE:
           case TOKEN_LBRACE:
               if (!current->dump_done) {
  @@ -1211,7 +1213,8 @@
                   break;
   
               case TOKEN_RE:
  -            case TOKEN_RBRACE: /* cannot happen */
  +            case TOKEN_RBRACE:
  +            case TOKEN_GROUP:
                   ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                                 "Invalid expression \"%s\" in file %s",
                                 expr, r->filename);
  @@ -1330,23 +1333,7 @@
                   return retval;
               }
   
  -            /* empty groups return TRUE (backwards compat) */
  -            if (!current->right) {
  -                CREATE_NODE(ctx, current->right);
  -                TYPE_TOKEN(&current->right->token, TOKEN_STRING);
  -                current->right->token.value = "()";
  -            }
  -
  -            current->right->parent = current->parent;
  -            if (!current->parent) {
  -                current = root = current->right;
  -            }
  -            else if (current->parent->left == current) {
  -                current = current->parent->left = current->right;
  -            }
  -            else {
  -                current = current->parent->right = current->right;
  -            }
  +            TYPE_TOKEN(&current->token, TOKEN_GROUP);
               break;
   
           case TOKEN_NOT:
  @@ -1354,7 +1341,8 @@
               switch (current->token.type) {
               case TOKEN_STRING:
               case TOKEN_RE:
  -            case TOKEN_RBRACE: /* cannot happen */
  +            case TOKEN_RBRACE:
  +            case TOKEN_GROUP:
                   ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                                 "Invalid expression \"%s\" in file %s",
                                 expr, r->filename);
  @@ -1369,6 +1357,9 @@
               new->parent = current;
               current = new;
               break;
  +
  +        default:
  +            break;
           }
       }
   
  @@ -1562,6 +1553,23 @@
               }
               else {
                   current->value = 0;
  +            }
  +
  +            DEBUG_DUMP_EVAL(ctx, current);
  +            current->done = 1;
  +            current = current->parent;
  +            break;
  +
  +        case TOKEN_GROUP:
  +            if (current->right) {
  +                if (!current->right->done) {
  +                    current = current->right;
  +                    continue;
  +                }
  +                current->value = current->right->value;
  +            }
  +            else {
  +                current->value = 1;
               }
   
               DEBUG_DUMP_EVAL(ctx, current);
  
  
  

Mime
View raw message