OSSP CVS Repository

ossp - Difference in ossp-pkg/l2/l2_ut_pcre.c versions 1.4 and 1.5
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/l2/l2_ut_pcre.c 1.4 -> 1.5

--- l2_ut_pcre.c 2001/11/24 08:13:25     1.4
+++ l2_ut_pcre.c 2001/12/21 10:50:01     1.5
@@ -6,7 +6,7 @@
  *  DO NOT EDIT THIS FILE, IT WAS AUTOMATICALLY GENERATED!
  *
  *  This is an automatically generated, extremely stripped down
- *  version of the PCRE 3.7 library from the Philip Hazel.
+ *  version of the PCRE 3.8 library from the Philip Hazel.
  *  This version is still distributed under the same original PCRE
  *  Open Source license, but Philip Hazel is no longer responsible
  *  for this version.
@@ -392,12 +392,12 @@
   if (md->utf8 && (c & 0xc0) == 0xc0) \
     { \
     int a = utf8_table4[c & 0x3f];   \
-    int s = 6 - a;                    \
-    c &= utf8_table3[a];             \
+    int s = 6*a; \
+    c = (c & utf8_table3[a]) << s; \
     while (a-- > 0) \
       { \
+      s -= 6; \
       c |= (*eptr++ & 0x3f) << s; \
-      s += 6; \
       } \
     }
 
@@ -408,12 +408,12 @@
     { \
     int i; \
     int a = utf8_table4[c & 0x3f];   \
-    int s = 6 - a;                    \
-    c &= utf8_table3[a];             \
+    int s = 6*a; \
+    c = (c & utf8_table3[a]) << s; \
     for (i = 1; i <= a; i++) \
       { \
+      s -= 6; \
       c |= (eptr[i] & 0x3f) << s; \
-      s += 6; \
       } \
     len += a; \
     }
@@ -445,12 +445,12 @@
         for (i = 0; i < sizeof (utf8_table1) / sizeof (int); i++)
                 if (cvalue <= utf8_table1[i])
                         break;
-        *buffer++ = utf8_table2[i] | (cvalue & utf8_table3[i]);
-        cvalue >>= 6 - i;
-        for (j = 0; j < i; j++) {
-                *buffer++ = 0x80 | (cvalue & 0x3f);
+        buffer += i;
+        for (j = i; j > 0; j--) {
+                *buffer-- = 0x80 | (cvalue & 0x3f);
                 cvalue >>= 6;
         }
+        *buffer = utf8_table2[i] | cvalue;
         return i + 1;
 }
 #endif

CVSTrac 2.0.1