From: Brian Pane Date: Sun, 2 Dec 2001 18:44:06 +0000 (+0000) Subject: Added faster logic for decodehtml to handle the special case X-Git-Tag: 2.0.30~308 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=78e6faa6725939afa8e6aee560ecfc62e080be69;p=thirdparty%2Fapache%2Fhttpd.git 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=...') git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92284 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_include.c b/modules/filters/mod_include.c index 5691826d83e..98dac768861 100644 --- a/modules/filters/mod_include.c +++ b/modules/filters/mod_include.c @@ -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;