Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 78260 invoked by uid 500); 2 Dec 2001 19:02:08 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 78230 invoked by uid 500); 2 Dec 2001 19:02:08 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 2 Dec 2001 18:44:06 -0000 Message-ID: <20011202184406.20436.qmail@icarus.apache.org> From: brianp@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/filters mod_include.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N brianp 01/12/02 10:44:06 Modified: modules/filters mod_include.c Log: Added faster logic for decodehtml to handle the special case where the string being decoded doesn't have any ampersands in it (e.g., because it's the value for an 'include virtual=...') Revision Changes Path 1.162 +11 -2 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.161 retrieving revision 1.162 diff -u -r1.161 -r1.162 --- mod_include.c 2001/12/02 10:33:01 1.161 +++ mod_include.c 2001/12/02 18:44:06 1.162 @@ -688,7 +688,7 @@ 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 @@ 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;