From: Brian Pane Date: Sat, 1 Dec 2001 05:38:23 +0000 (+0000) Subject: Fix the handling of SSI directives in which the ">" of the X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca728777f12ff0a5f5f1838775cd55068a51f1b1;p=apache Fix the handling of SSI directives in which the ">" of the terminating "-->" is the last byte in a file (previously, the output of the directive was lost in this case). git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92275 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index de16cd5764..b1cb0bb51e 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,8 @@ Changes with Apache 2.0.30-dev + *) Fix the handling of SSI directives in which the ">" of the + terminating "-->" is the last byte in a file [Brian Pane] + *) Add back in the "suEXEC mechanism enabled (wrapper: /path/to/suexec)" message that we had back in apache-1.3 and still have scattered throughout our docs. [Aaron Bannert] diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 0b0059df87..07ea081963 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -525,6 +525,19 @@ static apr_bucket *find_end_sequence(apr_bucket *dptr, include_ctx_t *ctx, ctx->tail_start_index = c - buf; } ctx->parse_pos++; + if (str[ctx->parse_pos] == '\0') { + apr_bucket *tmp_buck = dptr; + + /* We want to split the bucket at the '>'. The + * end of the END_SEQUENCE is in the current bucket. + * The beginning might be in a previous bucket. + */ + ctx->bytes_parsed++; + ctx->state = PARSED; + apr_bucket_split(dptr, c - buf + 1); + tmp_buck = APR_BUCKET_NEXT(dptr); + return (tmp_buck); + } } else { if (ctx->state == PARSE_DIRECTIVE) { @@ -550,22 +563,7 @@ static apr_bucket *find_end_sequence(apr_bucket *dptr, include_ctx_t *ctx, ctx->tag_length++; } else { - if (str[ctx->parse_pos] == '\0') { - apr_bucket *tmp_buck = dptr; - - /* We want to split the bucket at the '>'. The - * end of the END_SEQUENCE is in the current bucket. - * The beginning might be in a previous bucket. - */ - ctx->bytes_parsed++; - ctx->state = PARSED; - if ((c - buf) > 0) { - apr_bucket_split(dptr, c - buf); - tmp_buck = APR_BUCKET_NEXT(dptr); - } - return (tmp_buck); - } - else if (ctx->parse_pos != 0) { + if (ctx->parse_pos != 0) { /* The reason for this, is that we need to make sure * that we catch cases like --->. This makes the * second check after the original check fails.