/[pcre]/code/trunk/pcre.c
ViewVC logotype

Diff of /code/trunk/pcre.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 58 by nigel, Sat Feb 24 21:39:46 2007 UTC revision 59 by nigel, Sat Feb 24 21:39:54 2007 UTC
# Line 211  byte-mode, and more complicated ones for Line 211  byte-mode, and more complicated ones for
211    if (md->utf8 && (c & 0xc0) == 0xc0) \    if (md->utf8 && (c & 0xc0) == 0xc0) \
212      { \      { \
213      int a = utf8_table4[c & 0x3f];  /* Number of additional bytes */ \      int a = utf8_table4[c & 0x3f];  /* Number of additional bytes */ \
214      int s = 6 - a;                  /* Amount to shift next byte */  \      int s = 6*a; \
215      c &= utf8_table3[a];            /* Low order bits from first byte */ \      c = (c & utf8_table3[a]) << s; \
216      while (a-- > 0) \      while (a-- > 0) \
217        { \        { \
218          s -= 6; \
219        c |= (*eptr++ & 0x3f) << s; \        c |= (*eptr++ & 0x3f) << s; \
       s += 6; \  
220        } \        } \
221      }      }
222    
# Line 229  byte-mode, and more complicated ones for Line 229  byte-mode, and more complicated ones for
229      { \      { \
230      int i; \      int i; \
231      int a = utf8_table4[c & 0x3f];  /* Number of additional bytes */ \      int a = utf8_table4[c & 0x3f];  /* Number of additional bytes */ \
232      int s = 6 - a;                  /* Amount to shift next byte */  \      int s = 6*a; \
233      c &= utf8_table3[a];            /* Low order bits from first byte */ \      c = (c & utf8_table3[a]) << s; \
234      for (i = 1; i <= a; i++) \      for (i = 1; i <= a; i++) \
235        { \        { \
236          s -= 6; \
237        c |= (eptr[i] & 0x3f) << s; \        c |= (eptr[i] & 0x3f) << s; \
       s += 6; \  
238        } \        } \
239      len += a; \      len += a; \
240      }      }
# Line 309  ord2utf8(int cvalue, uschar *buffer) Line 309  ord2utf8(int cvalue, uschar *buffer)
309  register int i, j;  register int i, j;
310  for (i = 0; i < sizeof(utf8_table1)/sizeof(int); i++)  for (i = 0; i < sizeof(utf8_table1)/sizeof(int); i++)
311    if (cvalue <= utf8_table1[i]) break;    if (cvalue <= utf8_table1[i]) break;
312  *buffer++ = utf8_table2[i] | (cvalue & utf8_table3[i]);  buffer += i;
313  cvalue >>= 6 - i;  for (j = i; j > 0; j--)
314  for (j = 0; j < i; j++)   {
315    {   *buffer-- = 0x80 | (cvalue & 0x3f);
316    *buffer++ = 0x80 | (cvalue & 0x3f);   cvalue >>= 6;
317    cvalue >>= 6;   }
318    }  *buffer = utf8_table2[i] | cvalue;
319  return i + 1;  return i + 1;
320  }  }
321  #endif  #endif

Legend:
Removed from v.58  
changed lines
  Added in v.59

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12