httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bri...@apache.org
Subject cvs commit: httpd-2.0/modules/filters mod_include.c
Date Sun, 02 Dec 2001 18:44:06 GMT
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;
  
  
  

Mime
View raw message