[webkit-changes] cvs commit: JavaScriptCore/pcre pcre_compile.c

Darin darin at opensource.apple.com
Thu Sep 8 17:15:53 PDT 2005


darin       05/09/08 17:15:53

  Modified:    pcre     Tag: pcre-6-1-branch pcre_compile.c
  Log:
  Took out one unnecessary and incorrect UTF-16 code path for escaped
  characters -- the UTF-8 code path already correctly computes the length.
  
  Also fixed one place to use a more efficient manner to compute the length
  of a UTF-8 sequence.
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.6   +5 -11     JavaScriptCore/pcre/Attic/pcre_compile.c
  
  Index: pcre_compile.c
  ===================================================================
  RCS file: /cvs/root/JavaScriptCore/pcre/Attic/pcre_compile.c,v
  retrieving revision 1.1.2.5
  retrieving revision 1.1.2.6
  diff -u -r1.1.2.5 -r1.1.2.6
  --- pcre_compile.c	17 Aug 2005 00:05:55 -0000	1.1.2.5
  +++ pcre_compile.c	9 Sep 2005 00:15:52 -0000	1.1.2.6
  @@ -4055,13 +4055,6 @@
         {
         length += 2;          /* For a one-byte character */
   
  -#if PCRE_UTF16
  -      if (IS_LEADING_SURROGATE(c))
  -        {
  -        length++;
  -        lastitemlength++;
  -        }
  -#else
   #ifdef SUPPORT_UTF8
         if (utf8 && c > 127)
           {
  @@ -4072,7 +4065,6 @@
           lastitemlength += i;
           }
   #endif
  -#endif
   
         continue;
         }
  @@ -4901,9 +4893,11 @@
             c = DECODE_SURROGATE_PAIR(c, *ptr);
             ++ptr;
             }
  -        char utf8Buffer[6];
  -        lastitemlength = _pcre_ord2utf8(c, utf8Buffer);
  -        length += lastitemlength - 1;
  +        int i;
  +        for (i = 0; i < _pcre_utf8_table1_size; i++)
  +          if (c <= _pcre_utf8_table1[i]) break;
  +        length += i - 1;
  +        lastitemlength = i;
         }
   #else
   #ifdef SUPPORT_UTF8
  
  
  



More information about the webkit-changes mailing list