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

Diff of /code/trunk/pcre_exec.c

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

revision 1397 by ph10, Mon Nov 11 18:33:23 2013 UTC revision 1431 by ph10, Thu Jan 2 17:41:28 2014 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2013 University of Cambridge             Copyright (c) 1997-2014 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 134  pcre_uint32 c; Line 134  pcre_uint32 c;
134  BOOL utf = md->utf;  BOOL utf = md->utf;
135  if (is_subject && length > md->end_subject - p) length = md->end_subject - p;  if (is_subject && length > md->end_subject - p) length = md->end_subject - p;
136  while (length-- > 0)  while (length-- > 0)
137    if (isprint(c = RAWUCHARINCTEST(p))) printf("%c", (char)c); else printf("\\x{%02x}", c);    if (isprint(c = UCHAR21INCTEST(p))) printf("%c", (char)c); else printf("\\x{%02x}", c);
138  }  }
139  #endif  #endif
140    
# Line 167  match_ref(int offset, register PCRE_PUCH Line 167  match_ref(int offset, register PCRE_PUCH
167  {  {
168  PCRE_PUCHAR eptr_start = eptr;  PCRE_PUCHAR eptr_start = eptr;
169  register PCRE_PUCHAR p = md->start_subject + md->offset_vector[offset];  register PCRE_PUCHAR p = md->start_subject + md->offset_vector[offset];
170  #ifdef SUPPORT_UTF  #if defined SUPPORT_UTF && defined SUPPORT_UCP
171  BOOL utf = md->utf;  BOOL utf = md->utf;
172  #endif  #endif
173    
# Line 195  ASCII characters. */ Line 195  ASCII characters. */
195    
196  if (caseless)  if (caseless)
197    {    {
198  #ifdef SUPPORT_UTF  #if defined SUPPORT_UTF && defined SUPPORT_UCP
 #ifdef SUPPORT_UCP  
199    if (utf)    if (utf)
200      {      {
201      /* Match characters up to the end of the reference. NOTE: the number of      /* Match characters up to the end of the reference. NOTE: the number of
# Line 230  if (caseless) Line 229  if (caseless)
229      }      }
230    else    else
231  #endif  #endif
 #endif  
232    
233    /* The same code works when not in UTF-8 mode and in UTF-8 mode when there    /* The same code works when not in UTF-8 mode and in UTF-8 mode when there
234    is no UCP support. */    is no UCP support. */
# Line 239  if (caseless) Line 237  if (caseless)
237        {        {
238        pcre_uint32 cc, cp;        pcre_uint32 cc, cp;
239        if (eptr >= md->end_subject) return -2;   /* Partial match */        if (eptr >= md->end_subject) return -2;   /* Partial match */
240        cc = RAWUCHARTEST(eptr);        cc = UCHAR21TEST(eptr);
241        cp = RAWUCHARTEST(p);        cp = UCHAR21TEST(p);
242        if (TABLE_GET(cp, md->lcc, cp) != TABLE_GET(cc, md->lcc, cc)) return -1;        if (TABLE_GET(cp, md->lcc, cp) != TABLE_GET(cc, md->lcc, cc)) return -1;
243        p++;        p++;
244        eptr++;        eptr++;
# Line 256  else Line 254  else
254    while (length-- > 0)    while (length-- > 0)
255      {      {
256      if (eptr >= md->end_subject) return -2;   /* Partial match */      if (eptr >= md->end_subject) return -2;   /* Partial match */
257      if (RAWUCHARINCTEST(p) != RAWUCHARINCTEST(eptr)) return -1;      if (UCHAR21INCTEST(p) != UCHAR21INCTEST(eptr)) return -1;
258      }      }
259    }    }
260    
# Line 312  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM Line 310  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM
310         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,
311         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,
312         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,
313         RM61,  RM62, RM63, RM64, RM65, RM66, RM67, RM68 };         RM61,  RM62, RM63, RM64, RM65, RM66, RM67 };
314    
315  /* These versions of the macros use the stack, as normal. There are debugging  /* These versions of the macros use the stack, as normal. There are debugging
316  versions and production versions. Note that the "rw" argument of RMATCH isn't  versions and production versions. Note that the "rw" argument of RMATCH isn't
# Line 2105  for (;;) Line 2103  for (;;)
2103              eptr + 1 >= md->end_subject &&              eptr + 1 >= md->end_subject &&
2104              NLBLOCK->nltype == NLTYPE_FIXED &&              NLBLOCK->nltype == NLTYPE_FIXED &&
2105              NLBLOCK->nllen == 2 &&              NLBLOCK->nllen == 2 &&
2106              RAWUCHARTEST(eptr) == NLBLOCK->nl[0])              UCHAR21TEST(eptr) == NLBLOCK->nl[0])
2107            {            {
2108            md->hitend = TRUE;            md->hitend = TRUE;
2109            if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);            if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
# Line 2149  for (;;) Line 2147  for (;;)
2147            eptr + 1 >= md->end_subject &&            eptr + 1 >= md->end_subject &&
2148            NLBLOCK->nltype == NLTYPE_FIXED &&            NLBLOCK->nltype == NLTYPE_FIXED &&
2149            NLBLOCK->nllen == 2 &&            NLBLOCK->nllen == 2 &&
2150            RAWUCHARTEST(eptr) == NLBLOCK->nl[0])            UCHAR21TEST(eptr) == NLBLOCK->nl[0])
2151          {          {
2152          md->hitend = TRUE;          md->hitend = TRUE;
2153          if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);          if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
# Line 2292  for (;;) Line 2290  for (;;)
2290          eptr + 1 >= md->end_subject &&          eptr + 1 >= md->end_subject &&
2291          NLBLOCK->nltype == NLTYPE_FIXED &&          NLBLOCK->nltype == NLTYPE_FIXED &&
2292          NLBLOCK->nllen == 2 &&          NLBLOCK->nllen == 2 &&
2293          RAWUCHARTEST(eptr) == NLBLOCK->nl[0])          UCHAR21TEST(eptr) == NLBLOCK->nl[0])
2294        {        {
2295        md->hitend = TRUE;        md->hitend = TRUE;
2296        if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);        if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
# Line 2446  for (;;) Line 2444  for (;;)
2444          {          {
2445          SCHECK_PARTIAL();          SCHECK_PARTIAL();
2446          }          }
2447        else if (RAWUCHARTEST(eptr) == CHAR_LF) eptr++;        else if (UCHAR21TEST(eptr) == CHAR_LF) eptr++;
2448        break;        break;
2449    
2450        case CHAR_LF:        case CHAR_LF:
# Line 2693  for (;;) Line 2691  for (;;)
2691        pcre_uchar *slot = md->name_table + GET2(ecode, 1) * md->name_entry_size;        pcre_uchar *slot = md->name_table + GET2(ecode, 1) * md->name_entry_size;
2692        ecode += 1 + 2*IMM2_SIZE;        ecode += 1 + 2*IMM2_SIZE;
2693    
2694          /* Setting the default length first and initializing 'offset' avoids
2695          compiler warnings in the REF_REPEAT code. */
2696    
2697          length = (md->jscript_compat)? 0 : -1;
2698          offset = 0;
2699    
2700        while (count-- > 0)        while (count-- > 0)
2701          {          {
2702          offset = GET2(slot, 0) << 1;          offset = GET2(slot, 0) << 1;
2703          if (offset < offset_top && md->offset_vector[offset] >= 0) break;          if (offset < offset_top && md->offset_vector[offset] >= 0)
2704              {
2705              length = md->offset_vector[offset+1] - md->offset_vector[offset];
2706              break;
2707              }
2708          slot += md->name_entry_size;          slot += md->name_entry_size;
2709          }          }
       if (count < 0)  
         length = (md->jscript_compat)? 0 : -1;  
       else  
         length = md->offset_vector[offset+1] - md->offset_vector[offset];  
2710        }        }
2711      goto REF_REPEAT;      goto REF_REPEAT;
2712    
# Line 3075  for (;;) Line 3079  for (;;)
3079      /* Control never gets here */      /* Control never gets here */
3080    
3081    
3082      /* Match an extended character class. This opcode is encountered only      /* Match an extended character class. In the 8-bit library, this opcode is
3083      when UTF-8 mode mode is supported. Nevertheless, we may not be in UTF-8      encountered only when UTF-8 mode mode is supported. In the 16-bit and
3084      mode, because Unicode properties are supported in non-UTF-8 mode. */      32-bit libraries, codepoints greater than 255 may be encountered even when
3085        UTF is not supported. */
3086    
3087  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
3088      case OP_XCLASS:      case OP_XCLASS:
# Line 3213  for (;;) Line 3218  for (;;)
3218          CHECK_PARTIAL();             /* Not SCHECK_PARTIAL() */          CHECK_PARTIAL();             /* Not SCHECK_PARTIAL() */
3219          RRETURN(MATCH_NOMATCH);          RRETURN(MATCH_NOMATCH);
3220          }          }
3221        while (length-- > 0) if (*ecode++ != RAWUCHARINC(eptr)) RRETURN(MATCH_NOMATCH);        while (length-- > 0) if (*ecode++ != UCHAR21INC(eptr)) RRETURN(MATCH_NOMATCH);
3222        }        }
3223      else      else
3224  #endif  #endif
# Line 3253  for (;;) Line 3258  for (;;)
3258    
3259        if (fc < 128)        if (fc < 128)
3260          {          {
3261          pcre_uint32 cc = RAWUCHAR(eptr);          pcre_uint32 cc = UCHAR21(eptr);
3262          if (md->lcc[fc] != TABLE_GET(cc, md->lcc, cc)) RRETURN(MATCH_NOMATCH);          if (md->lcc[fc] != TABLE_GET(cc, md->lcc, cc)) RRETURN(MATCH_NOMATCH);
3263          ecode++;          ecode++;
3264          eptr++;          eptr++;
# Line 3522  for (;;) Line 3527  for (;;)
3527            SCHECK_PARTIAL();            SCHECK_PARTIAL();
3528            RRETURN(MATCH_NOMATCH);            RRETURN(MATCH_NOMATCH);
3529            }            }
3530          cc = RAWUCHARTEST(eptr);          cc = UCHAR21TEST(eptr);
3531          if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);          if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);
3532          eptr++;          eptr++;
3533          }          }
# Line 3540  for (;;) Line 3545  for (;;)
3545              SCHECK_PARTIAL();              SCHECK_PARTIAL();
3546              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
3547              }              }
3548            cc = RAWUCHARTEST(eptr);            cc = UCHAR21TEST(eptr);
3549            if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);            if (fc != cc && foc != cc) RRETURN(MATCH_NOMATCH);
3550            eptr++;            eptr++;
3551            }            }
# Line 3557  for (;;) Line 3562  for (;;)
3562              SCHECK_PARTIAL();              SCHECK_PARTIAL();
3563              break;              break;
3564              }              }
3565            cc = RAWUCHARTEST(eptr);            cc = UCHAR21TEST(eptr);
3566            if (fc != cc && foc != cc) break;            if (fc != cc && foc != cc) break;
3567            eptr++;            eptr++;
3568            }            }
# Line 3584  for (;;) Line 3589  for (;;)
3589            SCHECK_PARTIAL();            SCHECK_PARTIAL();
3590            RRETURN(MATCH_NOMATCH);            RRETURN(MATCH_NOMATCH);
3591            }            }
3592          if (fc != RAWUCHARINCTEST(eptr)) RRETURN(MATCH_NOMATCH);          if (fc != UCHAR21INCTEST(eptr)) RRETURN(MATCH_NOMATCH);
3593          }          }
3594    
3595        if (min == max) continue;        if (min == max) continue;
# Line 3601  for (;;) Line 3606  for (;;)
3606              SCHECK_PARTIAL();              SCHECK_PARTIAL();
3607              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
3608              }              }
3609            if (fc != RAWUCHARINCTEST(eptr)) RRETURN(MATCH_NOMATCH);            if (fc != UCHAR21INCTEST(eptr)) RRETURN(MATCH_NOMATCH);
3610            }            }
3611          /* Control never gets here */          /* Control never gets here */
3612          }          }
# Line 3615  for (;;) Line 3620  for (;;)
3620              SCHECK_PARTIAL();              SCHECK_PARTIAL();
3621              break;              break;
3622              }              }
3623            if (fc != RAWUCHARTEST(eptr)) break;            if (fc != UCHAR21TEST(eptr)) break;
3624            eptr++;            eptr++;
3625            }            }
3626          if (possessive) continue;    /* No backtracking */          if (possessive) continue;    /* No backtracking */
# Line 4370  for (;;) Line 4375  for (;;)
4375                eptr + 1 >= md->end_subject &&                eptr + 1 >= md->end_subject &&
4376                NLBLOCK->nltype == NLTYPE_FIXED &&                NLBLOCK->nltype == NLTYPE_FIXED &&
4377                NLBLOCK->nllen == 2 &&                NLBLOCK->nllen == 2 &&
4378                RAWUCHAR(eptr) == NLBLOCK->nl[0])                UCHAR21(eptr) == NLBLOCK->nl[0])
4379              {              {
4380              md->hitend = TRUE;              md->hitend = TRUE;
4381              if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);              if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
# Line 4412  for (;;) Line 4417  for (;;)
4417              default: RRETURN(MATCH_NOMATCH);              default: RRETURN(MATCH_NOMATCH);
4418    
4419              case CHAR_CR:              case CHAR_CR:
4420              if (eptr < md->end_subject && RAWUCHAR(eptr) == CHAR_LF) eptr++;              if (eptr < md->end_subject && UCHAR21(eptr) == CHAR_LF) eptr++;
4421              break;              break;
4422    
4423              case CHAR_LF:              case CHAR_LF:
# Line 4522  for (;;) Line 4527  for (;;)
4527              SCHECK_PARTIAL();              SCHECK_PARTIAL();
4528              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4529              }              }
4530            cc = RAWUCHAR(eptr);            cc = UCHAR21(eptr);
4531            if (cc >= 128 || (md->ctypes[cc] & ctype_digit) == 0)            if (cc >= 128 || (md->ctypes[cc] & ctype_digit) == 0)
4532              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4533            eptr++;            eptr++;
# Line 4539  for (;;) Line 4544  for (;;)
4544              SCHECK_PARTIAL();              SCHECK_PARTIAL();
4545              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4546              }              }
4547            cc = RAWUCHAR(eptr);            cc = UCHAR21(eptr);
4548            if (cc < 128 && (md->ctypes[cc] & ctype_space) != 0)            if (cc < 128 && (md->ctypes[cc] & ctype_space) != 0)
4549              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4550            eptr++;            eptr++;
# Line 4556  for (;;) Line 4561  for (;;)
4561              SCHECK_PARTIAL();              SCHECK_PARTIAL();
4562              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4563              }              }
4564            cc = RAWUCHAR(eptr);            cc = UCHAR21(eptr);
4565            if (cc >= 128 || (md->ctypes[cc] & ctype_space) == 0)            if (cc >= 128 || (md->ctypes[cc] & ctype_space) == 0)
4566              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4567            eptr++;            eptr++;
# Line 4573  for (;;) Line 4578  for (;;)
4578              SCHECK_PARTIAL();              SCHECK_PARTIAL();
4579              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4580              }              }
4581            cc = RAWUCHAR(eptr);            cc = UCHAR21(eptr);
4582            if (cc < 128 && (md->ctypes[cc] & ctype_word) != 0)            if (cc < 128 && (md->ctypes[cc] & ctype_word) != 0)
4583              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4584            eptr++;            eptr++;
# Line 4590  for (;;) Line 4595  for (;;)
4595              SCHECK_PARTIAL();              SCHECK_PARTIAL();
4596              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4597              }              }
4598            cc = RAWUCHAR(eptr);            cc = UCHAR21(eptr);
4599            if (cc >= 128 || (md->ctypes[cc] & ctype_word) == 0)            if (cc >= 128 || (md->ctypes[cc] & ctype_word) == 0)
4600              RRETURN(MATCH_NOMATCH);              RRETURN(MATCH_NOMATCH);
4601            eptr++;            eptr++;
# Line 5054  for (;;) Line 5059  for (;;)
5059            case PT_UCNC:            case PT_UCNC:
5060            for (fi = min;; fi++)            for (fi = min;; fi++)
5061              {              {
5062              RMATCH(eptr, ecode, offset_top, md, eptrb, RM68);              RMATCH(eptr, ecode, offset_top, md, eptrb, RM60);
5063              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
5064              if (fi >= max) RRETURN(MATCH_NOMATCH);              if (fi >= max) RRETURN(MATCH_NOMATCH);
5065              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
# Line 5151  for (;;) Line 5156  for (;;)
5156                {                {
5157                default: RRETURN(MATCH_NOMATCH);                default: RRETURN(MATCH_NOMATCH);
5158                case CHAR_CR:                case CHAR_CR:
5159                if (eptr < md->end_subject && RAWUCHAR(eptr) == CHAR_LF) eptr++;                if (eptr < md->end_subject && UCHAR21(eptr) == CHAR_LF) eptr++;
5160                break;                break;
5161    
5162                case CHAR_LF:                case CHAR_LF:
# Line 5690  for (;;) Line 5695  for (;;)
5695                    eptr + 1 >= md->end_subject &&                    eptr + 1 >= md->end_subject &&
5696                    NLBLOCK->nltype == NLTYPE_FIXED &&                    NLBLOCK->nltype == NLTYPE_FIXED &&
5697                    NLBLOCK->nllen == 2 &&                    NLBLOCK->nllen == 2 &&
5698                    RAWUCHAR(eptr) == NLBLOCK->nl[0])                    UCHAR21(eptr) == NLBLOCK->nl[0])
5699                  {                  {
5700                  md->hitend = TRUE;                  md->hitend = TRUE;
5701                  if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);                  if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
# Line 5716  for (;;) Line 5721  for (;;)
5721                    eptr + 1 >= md->end_subject &&                    eptr + 1 >= md->end_subject &&
5722                    NLBLOCK->nltype == NLTYPE_FIXED &&                    NLBLOCK->nltype == NLTYPE_FIXED &&
5723                    NLBLOCK->nllen == 2 &&                    NLBLOCK->nllen == 2 &&
5724                    RAWUCHAR(eptr) == NLBLOCK->nl[0])                    UCHAR21(eptr) == NLBLOCK->nl[0])
5725                  {                  {
5726                  md->hitend = TRUE;                  md->hitend = TRUE;
5727                  if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);                  if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);
# Line 5773  for (;;) Line 5778  for (;;)
5778              if (c == CHAR_CR)              if (c == CHAR_CR)
5779                {                {
5780                if (++eptr >= md->end_subject) break;                if (++eptr >= md->end_subject) break;
5781                if (RAWUCHAR(eptr) == CHAR_LF) eptr++;                if (UCHAR21(eptr) == CHAR_LF) eptr++;
5782                }                }
5783              else              else
5784                {                {
# Line 5936  for (;;) Line 5941  for (;;)
5941            if (rrc != MATCH_NOMATCH) RRETURN(rrc);            if (rrc != MATCH_NOMATCH) RRETURN(rrc);
5942            eptr--;            eptr--;
5943            BACKCHAR(eptr);            BACKCHAR(eptr);
5944            if (ctype == OP_ANYNL && eptr > pp  && RAWUCHAR(eptr) == CHAR_NL &&            if (ctype == OP_ANYNL && eptr > pp  && UCHAR21(eptr) == CHAR_NL &&
5945                RAWUCHAR(eptr - 1) == CHAR_CR) eptr--;                UCHAR21(eptr - 1) == CHAR_CR) eptr--;
5946            }            }
5947          }          }
5948        else        else
# Line 6219  switch (frame->Xwhere) Line 6224  switch (frame->Xwhere)
6224    LBL(53) LBL(54) LBL(55) LBL(56) LBL(57) LBL(58) LBL(63) LBL(64)    LBL(53) LBL(54) LBL(55) LBL(56) LBL(57) LBL(58) LBL(63) LBL(64)
6225    LBL(65) LBL(66)    LBL(65) LBL(66)
6226  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8  #if defined SUPPORT_UTF || !defined COMPILE_PCRE8
6227    LBL(21)    LBL(20) LBL(21)
6228  #endif  #endif
6229  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
6230    LBL(16) LBL(18) LBL(20)    LBL(16) LBL(18)
6231    LBL(22) LBL(23) LBL(28) LBL(30)    LBL(22) LBL(23) LBL(28) LBL(30)
6232    LBL(32) LBL(34) LBL(42) LBL(46)    LBL(32) LBL(34) LBL(42) LBL(46)
6233  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
6234    LBL(36) LBL(37) LBL(38) LBL(39) LBL(40) LBL(41) LBL(44) LBL(45)    LBL(36) LBL(37) LBL(38) LBL(39) LBL(40) LBL(41) LBL(44) LBL(45)
6235    LBL(59) LBL(60) LBL(61) LBL(62) LBL(67) LBL(68)    LBL(59) LBL(60) LBL(61) LBL(62) LBL(67)
6236  #endif  /* SUPPORT_UCP */  #endif  /* SUPPORT_UCP */
6237  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
6238    default:    default:
# Line 6784  for(;;) Line 6789  for(;;)
6789    
6790        if (first_char != first_char2)        if (first_char != first_char2)
6791          while (start_match < end_subject &&          while (start_match < end_subject &&
6792            (smc = RAWUCHARTEST(start_match)) != first_char && smc != first_char2)            (smc = UCHAR21TEST(start_match)) != first_char && smc != first_char2)
6793            start_match++;            start_match++;
6794        else        else
6795          while (start_match < end_subject && RAWUCHARTEST(start_match) != first_char)          while (start_match < end_subject && UCHAR21TEST(start_match) != first_char)
6796            start_match++;            start_match++;
6797        }        }
6798    
# Line 6819  for(;;) Line 6824  for(;;)
6824          if (start_match[-1] == CHAR_CR &&          if (start_match[-1] == CHAR_CR &&
6825               (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&               (md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) &&
6826               start_match < end_subject &&               start_match < end_subject &&
6827               RAWUCHARTEST(start_match) == CHAR_NL)               UCHAR21TEST(start_match) == CHAR_NL)
6828            start_match++;            start_match++;
6829          }          }
6830        }        }
# Line 6830  for(;;) Line 6835  for(;;)
6835        {        {
6836        while (start_match < end_subject)        while (start_match < end_subject)
6837          {          {
6838          register pcre_uint32 c = RAWUCHARTEST(start_match);          register pcre_uint32 c = UCHAR21TEST(start_match);
6839  #ifndef COMPILE_PCRE8  #ifndef COMPILE_PCRE8
6840          if (c > 255) c = 255;          if (c > 255) c = 255;
6841  #endif  #endif
6842          if ((start_bits[c/8] & (1 << (c&7))) == 0)          if ((start_bits[c/8] & (1 << (c&7))) != 0) break;
6843            {          start_match++;
           start_match++;  
 #if defined SUPPORT_UTF && defined COMPILE_PCRE8  
           /* In non 8-bit mode, the iteration will stop for  
           characters > 255 at the beginning or not stop at all. */  
           if (utf)  
             ACROSSCHAR(start_match < end_subject, *start_match,  
               start_match++);  
 #endif  
           }  
         else break;  
6844          }          }
6845        }        }
6846      }   /* Starting optimizations */      }   /* Starting optimizations */
# Line 6898  for(;;) Line 6893  for(;;)
6893            {            {
6894            while (p < end_subject)            while (p < end_subject)
6895              {              {
6896              register pcre_uint32 pp = RAWUCHARINCTEST(p);              register pcre_uint32 pp = UCHAR21INCTEST(p);
6897              if (pp == req_char || pp == req_char2) { p--; break; }              if (pp == req_char || pp == req_char2) { p--; break; }
6898              }              }
6899            }            }
# Line 6906  for(;;) Line 6901  for(;;)
6901            {            {
6902            while (p < end_subject)            while (p < end_subject)
6903              {              {
6904              if (RAWUCHARINCTEST(p) == req_char) { p--; break; }              if (UCHAR21INCTEST(p) == req_char) { p--; break; }
6905              }              }
6906            }            }
6907    

Legend:
Removed from v.1397  
changed lines
  Added in v.1431

  ViewVC Help
Powered by ViewVC 1.1.5