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

Diff of /code/trunk/pcre_compile.c

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

revision 425 by ph10, Sat Apr 11 10:34:37 2009 UTC revision 426 by ph10, Wed Aug 26 15:38:32 2009 UTC
# Line 1423  for (;;) Line 1423  for (;;)
1423      branchlength++;      branchlength++;
1424      cc += 2;      cc += 2;
1425  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1426      if ((options & PCRE_UTF8) != 0)      if ((options & PCRE_UTF8) != 0 && cc[-1] >= 0xc0)
1427        {        cc += _pcre_utf8_table4[cc[-1] & 0x3f];
       while ((*cc & 0xc0) == 0x80) cc++;  
       }  
1428  #endif  #endif
1429      break;      break;
1430    
# Line 1437  for (;;) Line 1435  for (;;)
1435      branchlength += GET2(cc,1);      branchlength += GET2(cc,1);
1436      cc += 4;      cc += 4;
1437  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1438      if ((options & PCRE_UTF8) != 0)      if ((options & PCRE_UTF8) != 0 && cc[-1] >= 0xc0)
1439        {        cc += _pcre_utf8_table4[cc[-1] & 0x3f];
       while((*cc & 0x80) == 0x80) cc++;  
       }  
1440  #endif  #endif
1441      break;      break;
1442    
# Line 1912  for (code = first_significant_code(code Line 1908  for (code = first_significant_code(code
1908      case OP_QUERY:      case OP_QUERY:
1909      case OP_MINQUERY:      case OP_MINQUERY:
1910      case OP_POSQUERY:      case OP_POSQUERY:
1911        if (utf8 && code[1] >= 0xc0) code += _pcre_utf8_table4[code[1] & 0x3f];
1912        break;
1913    
1914      case OP_UPTO:      case OP_UPTO:
1915      case OP_MINUPTO:      case OP_MINUPTO:
1916      case OP_POSUPTO:      case OP_POSUPTO:
1917      if (utf8) while ((code[2] & 0xc0) == 0x80) code++;      if (utf8 && code[3] >= 0xc0) code += _pcre_utf8_table4[code[3] & 0x3f];
1918      break;      break;
1919  #endif  #endif
1920      }      }
# Line 3869  we set the flag only if there is a liter Line 3868  we set the flag only if there is a liter
3868    
3869        if (repeat_max == 0) goto END_REPEAT;        if (repeat_max == 0) goto END_REPEAT;
3870    
3871          /*--------------------------------------------------------------------*/
3872          /* This code is obsolete from release 8.00; the restriction was finally
3873          removed: */
3874    
3875        /* All real repeats make it impossible to handle partial matching (maybe        /* All real repeats make it impossible to handle partial matching (maybe
3876        one day we will be able to remove this restriction). */        one day we will be able to remove this restriction). */
3877    
3878        if (repeat_max != 1) cd->external_flags |= PCRE_NOPARTIAL;        /* if (repeat_max != 1) cd->external_flags |= PCRE_NOPARTIAL; */
3879          /*--------------------------------------------------------------------*/
3880    
3881        /* Combine the op_type with the repeat_type */        /* Combine the op_type with the repeat_type */
3882    
# Line 4019  we set the flag only if there is a liter Line 4023  we set the flag only if there is a liter
4023          goto END_REPEAT;          goto END_REPEAT;
4024          }          }
4025    
4026          /*--------------------------------------------------------------------*/
4027          /* This code is obsolete from release 8.00; the restriction was finally
4028          removed: */
4029    
4030        /* All real repeats make it impossible to handle partial matching (maybe        /* All real repeats make it impossible to handle partial matching (maybe
4031        one day we will be able to remove this restriction). */        one day we will be able to remove this restriction). */
4032    
4033        if (repeat_max != 1) cd->external_flags |= PCRE_NOPARTIAL;        /* if (repeat_max != 1) cd->external_flags |= PCRE_NOPARTIAL; */
4034          /*--------------------------------------------------------------------*/
4035    
4036        if (repeat_min == 0 && repeat_max == -1)        if (repeat_min == 0 && repeat_max == -1)
4037          *code++ = OP_CRSTAR + repeat_type;          *code++ = OP_CRSTAR + repeat_type;
# Line 4337  we set the flag only if there is a liter Line 4346  we set the flag only if there is a liter
4346      if (possessive_quantifier)      if (possessive_quantifier)
4347        {        {
4348        int len;        int len;
4349        if (*tempcode == OP_EXACT || *tempcode == OP_TYPEEXACT ||  
4350            *tempcode == OP_NOTEXACT)        if (*tempcode == OP_TYPEEXACT)
4351          tempcode += _pcre_OP_lengths[*tempcode] +          tempcode += _pcre_OP_lengths[*tempcode] +
4352            ((*tempcode == OP_TYPEEXACT &&            ((tempcode[3] == OP_PROP || tempcode[3] == OP_NOTPROP)? 2 : 0);
4353               (tempcode[3] == OP_PROP || tempcode[3] == OP_NOTPROP))? 2:0);  
4354          else if (*tempcode == OP_EXACT || *tempcode == OP_NOTEXACT)
4355            {
4356            tempcode += _pcre_OP_lengths[*tempcode];
4357    #ifdef SUPPORT_UTF8
4358            if (utf8 && tempcode[-1] >= 0xc0)
4359              tempcode += _pcre_utf8_table4[tempcode[-1] & 0x3f];
4360    #endif
4361            }
4362    
4363        len = code - tempcode;        len = code - tempcode;
4364        if (len > 0) switch (*tempcode)        if (len > 0) switch (*tempcode)
4365          {          {

Legend:
Removed from v.425  
changed lines
  Added in v.426

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12