From: André Malo Date: Mon, 25 Aug 2003 15:36:51 +0000 (+0000) Subject: simplify the dumper code X-Git-Tag: pre_ajp_proxy~1217 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9aac2831bdbf0d7395ceac67b36f81af824cf162;p=apache simplify the dumper code git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101095 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index fae20bbc7b..e4290ed1dd 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -335,35 +335,10 @@ static void debug_dump_tree(include_ctx_t *ctx, parse_node_t *root) current = current->parent; continue; - case TOKEN_AND: - case TOKEN_OR: - case TOKEN_EQ: - case TOKEN_NE: - case TOKEN_GE: - case TOKEN_LE: - case TOKEN_GT: - case TOKEN_LT: - if (!current->dump_done) { - debug_printf(ctx, "%s%s\n", is, current->token.s); - is = apr_pstrcat(ctx->dpool, is, " ", NULL); - current->dump_done = 1; - } - - DUMP__CHILD(ctx, is, current, left) - DUMP__CHILD(ctx, is, current, right) - - if ((!current->left || current->left->dump_done) && - (!current->right || current->right->dump_done)) { - - is = apr_pstrmemdup(ctx->dpool, is, strlen(is) - 4); - if (current->left) current->left->dump_done = 0; - if (current->right) current->right->dump_done = 0; - current = current->parent; - } - continue; - case TOKEN_NOT: case TOKEN_GROUP: + case TOKEN_RBRACE: + case TOKEN_LBRACE: if (!current->dump_done) { debug_printf(ctx, "%s%s\n", is, current->token.s); is = apr_pstrcat(ctx->dpool, is, " ", NULL); @@ -379,18 +354,21 @@ static void debug_dump_tree(include_ctx_t *ctx, parse_node_t *root) } continue; - case TOKEN_RBRACE: - case TOKEN_LBRACE: + default: if (!current->dump_done) { - debug_printf(ctx, "%sunmatched %s\n", is, current->token.s); + debug_printf(ctx, "%s%s\n", is, current->token.s); is = apr_pstrcat(ctx->dpool, is, " ", NULL); current->dump_done = 1; } + DUMP__CHILD(ctx, is, current, left) DUMP__CHILD(ctx, is, current, right) - if (!current->right || current->right->dump_done) { + if ((!current->left || current->left->dump_done) && + (!current->right || current->right->dump_done)) { + is = apr_pstrmemdup(ctx->dpool, is, strlen(is) - 4); + if (current->left) current->left->dump_done = 0; if (current->right) current->right->dump_done = 0; current = current->parent; } @@ -422,10 +400,10 @@ static void debug_dump_tree(include_ctx_t *ctx, parse_node_t *root) token_t *d__t = (token); \ \ if (d__t->type == TOKEN_STRING || d__t->type == TOKEN_RE) { \ - DEBUG_PRINTF(((ctx), " Token: %s (%s)\n", d__t->s, d__t->value)); \ + DEBUG_PRINTF(((ctx), " Found: %s (%s)\n", d__t->s, d__t->value)); \ } \ else { \ - DEBUG_PRINTF((ctx, " Token: %s\n", d__t->s)); \ + DEBUG_PRINTF((ctx, " Found: %s\n", d__t->s)); \ } \ } while(0)