]> granicus.if.org Git - apache/commitdiff
Added faster logic for decodehtml to handle the special case
authorBrian Pane <brianp@apache.org>
Sun, 2 Dec 2001 18:44:06 +0000 (18:44 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 2 Dec 2001 18:44:06 +0000 (18:44 +0000)
where the string being decoded doesn't have any ampersands
in it (e.g., because it's the value for an 'include virtual=...')

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

modules/filters/mod_include.c

index 5691826d83e2dfaa6a49ddf2d0376f233ed4a9b5..98dac768861b707672a12dad64c31b33c69eba2b 100644 (file)
@@ -688,7 +688,7 @@ static apr_status_t get_combined_directive (include_ctx_t *ctx,
 static void decodehtml(char *s)
 {
     int val, i, j;
-    char *p = s;
+    char *p;
     const char *ents;
     static const char * const entlist[MAXENTLEN + 1] =
     {
@@ -708,7 +708,16 @@ egrave\350eacute\351igrave\354iacute\355ntilde\361ograve\362oacute\363\
 otilde\365oslash\370ugrave\371uacute\372yacute\375"     /* 6 */
     };
 
-    for (; *s != '\0'; s++, p++) {
+    /* Do a fast scan through the string until we find anything
+     * that needs more complicated handling
+     */
+    for (; *s != '&'; s++) {
+        if (*s == '\0') {
+            return;
+        }
+    }
+
+    for (p = s; *s != '\0'; s++, p++) {
         if (*s != '&') {
             *p = *s;
             continue;