/[pcre]/code/branches/pcre16/pcre_compile.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_compile.c

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

revision 785 by zherczeg, Mon Dec 5 20:12:24 2011 UTC revision 786 by zherczeg, Tue Dec 6 11:33:41 2011 UTC
# Line 3738  for (;; ptr++) Line 3738  for (;; ptr++)
3738        {        {
3739        const pcre_uchar *oldptr;        const pcre_uchar *oldptr;
3740    
3741  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
3742        if (utf && c > 127)        if (utf && HAS_EXTRALEN(c))
3743          {                           /* Braces are required because the */          {                           /* Braces are required because the */
3744          GETCHARLEN(c, ptr, ptr);    /* macro generates multiple statements */          GETCHARLEN(c, ptr, ptr);    /* macro generates multiple statements */
3745          }          }
# Line 4317  for (;; ptr++) Line 4317  for (;; ptr++)
4317    
4318  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
4319        if (utf && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127)))        if (utf && (c > 255 || ((options & PCRE_CASELESS) != 0 && c > 127)))
4320  #endif  #elif !(defined COMPILE_PCRE8)
 #ifndef COMPILE_PCRE8  
4321        if (c > 255)        if (c > 255)
4322  #endif  #endif
4323  #if defined SUPPORT_UTF || defined COMPILE_PCRE16  #if defined SUPPORT_UTF || !(defined COMPILE_PCRE8)
4324          {          {
4325          xclass = TRUE;          xclass = TRUE;
4326          *class_uchardata++ = XCL_SINGLE;          *class_uchardata++ = XCL_SINGLE;
# Line 4345  for (;; ptr++) Line 4344  for (;; ptr++)
4344    
4345          }          }
4346        else        else
4347  #endif  /* SUPPORT_UTF8 */  #endif  /* SUPPORT_UTF || COMPILE_PCRE16 */
   
4348        /* Handle a single-byte character */        /* Handle a single-byte character */
4349          {          {
4350          classbits[c/8] |= (1 << (c&7));          classbits[c/8] |= (1 << (c&7));
# Line 4358  for (;; ptr++) Line 4356  for (;; ptr++)
4356          class_charcount++;          class_charcount++;
4357          class_lastchar = c;          class_lastchar = c;
4358          }          }
4359    
4360        }        }
4361    
4362      /* Loop until ']' reached. This "while" is the end of the "do" far above.      /* Loop until ']' reached. This "while" is the end of the "do" far above.
# Line 5849  for (;; ptr++) Line 5848  for (;; ptr++)
5848    
5849              for (i = 0; i < cd->names_found; i++)              for (i = 0; i < cd->names_found; i++)
5850                {                {
5851                int crc = memcmp(name, slot+2, namelen);                int crc = memcmp(name, slot+2, IN_UCHARS(namelen));
5852                if (crc == 0)                if (crc == 0)
5853                  {                  {
5854                  if (slot[2+namelen] == 0)                  if (slot[2+namelen] == 0)
# Line 7440  while (ptr[skipatstart] == CHAR_LEFT_PAR Line 7439  while (ptr[skipatstart] == CHAR_LEFT_PAR
7439    int newnl = 0;    int newnl = 0;
7440    int newbsr = 0;    int newbsr = 0;
7441    
7442    if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF8_RIGHTPAR, 5) == 0)    if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UTF_RIGHTPAR, 5) == 0)
7443      { skipatstart += 7; options |= PCRE_UTF8; continue; }      { skipatstart += 7; options |= PCRE_UTF8; continue; }
7444    else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UCP_RIGHTPAR, 4) == 0)    else if (STRNCMP_UC_C8(ptr+skipatstart+2, STRING_UCP_RIGHTPAR, 4) == 0)
7445      { skipatstart += 6; options |= PCRE_UCP; continue; }      { skipatstart += 6; options |= PCRE_UCP; continue; }
# Line 7805  if ((re->options & PCRE_ANCHORED) == 0) Line 7804  if ((re->options & PCRE_ANCHORED) == 0)
7804              if (cd->fcc[re->first_char] != re->first_char)              if (cd->fcc[re->first_char] != re->first_char)
7805                re->flags |= PCRE_FCH_CASELESS;                re->flags |= PCRE_FCH_CASELESS;
7806              }              }
7807            else if ((options & PCRE_UCP) != 0            else if (UCD_OTHERCASE(re->first_char) != re->first_char)
               && UCD_OTHERCASE(re->first_char) != re->first_char)  
7808              re->flags |= PCRE_FCH_CASELESS;              re->flags |= PCRE_FCH_CASELESS;
7809            }            }
7810          else          else
# Line 7843  if (reqchar >= 0 && Line 7841  if (reqchar >= 0 &&
7841      /* We ignore non-ASCII first chars in 8 bit mode. */      /* We ignore non-ASCII first chars in 8 bit mode. */
7842      if (utf)      if (utf)
7843        {        {
7844        if (re->first_char < 128)        if (re->req_char < 128)
7845          {          {
7846          if (cd->fcc[re->first_char] != re->first_char)          if (cd->fcc[re->req_char] != re->req_char)
7847            re->flags |= PCRE_RCH_CASELESS;            re->flags |= PCRE_RCH_CASELESS;
7848          }          }
7849        else if ((options & PCRE_UCP) != 0        else if (UCD_OTHERCASE(re->req_char) != re->req_char)
           && UCD_OTHERCASE(re->first_char) != re->first_char)  
7850          re->flags |= PCRE_RCH_CASELESS;          re->flags |= PCRE_RCH_CASELESS;
7851        }        }
7852      else      else

Legend:
Removed from v.785  
changed lines
  Added in v.786

  ViewVC Help
Powered by ViewVC 1.1.5