]> granicus.if.org Git - apache/commitdiff
Added code to ap_ssi_get_tag_and_value() to avoid converting
authorBrian Pane <brianp@apache.org>
Sun, 2 Dec 2001 19:16:01 +0000 (19:16 +0000)
committerBrian Pane <brianp@apache.org>
Sun, 2 Dec 2001 19:16:01 +0000 (19:16 +0000)
SSI tags to lowercase when they're already lowercase (in my
experience, this special case happens often enough to be
worth optimizing)

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

modules/filters/mod_include.c

index 98dac768861b707672a12dad64c31b33c69eba2b..1a3eac5ce226f909a67a238c7ddfef43c226e67e 100644 (file)
@@ -794,7 +794,11 @@ static void ap_ssi_get_tag_and_value(include_ctx_t *ctx, char **tag,
     SKIP_TAG_WHITESPACE(c);
     *tag = c;             /* First non-whitespace character (could be NULL). */
 
-    while ((*c != '\0') && (*c != '=') && (!apr_isspace(*c))) {
+    while (apr_islower(*c)) {
+        c++;  /* Optimization for the common case where the tag */
+    }         /* is already lowercase */
+
+    while ((*c != '=') && (!apr_isspace(*c)) && (*c != '\0')) {
         *c = apr_tolower(*c);    /* find end of tag, lowercasing as we go... */
         c++;
     }