]> granicus.if.org Git - apache/commitdiff
if the tokenizer hits a string which begins with a backslash, this
authorAndré Malo <nd@apache.org>
Mon, 25 Aug 2003 03:30:50 +0000 (03:30 +0000)
committerAndré Malo <nd@apache.org>
Mon, 25 Aug 2003 03:30:50 +0000 (03:30 +0000)
backslash will be skipped and not recognized as an escape character.
That way, <!--#if expr="\)"--> or the like won't work correctly.
Fix it now.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101093 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/filters/mod_include.c

diff --git a/CHANGES b/CHANGES
index 4cab6333658652ecc991785daffb11a008a2c3c1..6edcddbec26e910d606116913bde8f95fcceb7a8 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@ Changes with Apache 2.1.0-dev
 
   [Remove entries to the current 2.0 section below, when backported]
 
+  *) Fix mod_include's expression parser to recognize strings correctly
+     even if they start with an escaped token.  [André Malo]
+
   *) Major overhaul of mod_include's filter parser. The new parser code
      is expected to be more robust and should catch all of the edge cases
      that were not handled by the previous one. This includes a binary
index 034e2165be2206761839d222342c5ef0dc5367a2..fae20bbc7bd973db3e3986dbad6e4bcc9379820d 100644 (file)
@@ -1056,14 +1056,12 @@ static int get_ptoken(apr_pool_t *pool, const char **parse, token_t *token)
         return 0;
     }
 
-    /*
-     * It's a string or regex token
+    /* It's a string or regex token
+     * Now search for the next token, which finishes this string
      */
-    token->value = unmatched ? *parse : p;
-
-    /* Now search for the next token, which finishes this string */
     shift = 0;
-    p = *parse;
+    p = *parse = token->value = unmatched ? *parse : p;
+
     for (; **parse; p = ++*parse) {
         if (**parse == '\\') {
             if (!*(++*parse)) {