/[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 517 by ph10, Wed May 5 10:44:20 2010 UTC revision 551 by ph10, Sun Oct 10 17:33:07 2010 UTC
# Line 255  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM Line 255  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM
255         RM21,  RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30,         RM21,  RM22, RM23, RM24, RM25, RM26, RM27, RM28, RM29, RM30,
256         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,
257         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,
258         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58 };         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,
259           RM61,  RM62 };
260    
261  /* 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
262  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 294  argument of match(), which never changes Line 295  argument of match(), which never changes
295  #define RMATCH(ra,rb,rc,rd,re,rf,rg,rw)\  #define RMATCH(ra,rb,rc,rd,re,rf,rg,rw)\
296    {\    {\
297    heapframe *newframe = (pcre_stack_malloc)(sizeof(heapframe));\    heapframe *newframe = (pcre_stack_malloc)(sizeof(heapframe));\
298      if (newframe == NULL) RRETURN(PCRE_ERROR_NOMEMORY);\
299    frame->Xwhere = rw; \    frame->Xwhere = rw; \
300    newframe->Xeptr = ra;\    newframe->Xeptr = ra;\
301    newframe->Xecode = rb;\    newframe->Xecode = rb;\
# Line 314  argument of match(), which never changes Line 316  argument of match(), which never changes
316    
317  #define RRETURN(ra)\  #define RRETURN(ra)\
318    {\    {\
319    heapframe *newframe = frame;\    heapframe *oldframe = frame;\
320    frame = newframe->Xprevframe;\    frame = oldframe->Xprevframe;\
321    (pcre_stack_free)(newframe);\    (pcre_stack_free)(oldframe);\
322    if (frame != NULL)\    if (frame != NULL)\
323      {\      {\
324      rrc = ra;\      rrc = ra;\
# Line 487  heap whenever RMATCH() does a "recursion Line 489  heap whenever RMATCH() does a "recursion
489    
490  #ifdef NO_RECURSE  #ifdef NO_RECURSE
491  heapframe *frame = (pcre_stack_malloc)(sizeof(heapframe));  heapframe *frame = (pcre_stack_malloc)(sizeof(heapframe));
492    if (frame == NULL) RRETURN(PCRE_ERROR_NOMEMORY);
493  frame->Xprevframe = NULL;            /* Marks the top level */  frame->Xprevframe = NULL;            /* Marks the top level */
494    
495  /* Copy in the original argument variables */  /* Copy in the original argument variables */
# Line 707  for (;;) Line 710  for (;;)
710      case OP_FAIL:      case OP_FAIL:
711      MRRETURN(MATCH_NOMATCH);      MRRETURN(MATCH_NOMATCH);
712    
713        /* COMMIT overrides PRUNE, SKIP, and THEN */
714    
715      case OP_COMMIT:      case OP_COMMIT:
716      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
717        ims, eptrb, flags, RM52);        ims, eptrb, flags, RM52);
718      if (rrc != MATCH_NOMATCH) RRETURN(rrc);      if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE &&
719            rrc != MATCH_SKIP && rrc != MATCH_SKIP_ARG &&
720            rrc != MATCH_THEN)
721          RRETURN(rrc);
722      MRRETURN(MATCH_COMMIT);      MRRETURN(MATCH_COMMIT);
723    
724        /* PRUNE overrides THEN */
725    
726      case OP_PRUNE:      case OP_PRUNE:
727      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
728        ims, eptrb, flags, RM51);        ims, eptrb, flags, RM51);
729      if (rrc != MATCH_NOMATCH) RRETURN(rrc);      if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
730      MRRETURN(MATCH_PRUNE);      MRRETURN(MATCH_PRUNE);
731    
732      case OP_PRUNE_ARG:      case OP_PRUNE_ARG:
733      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,
734        ims, eptrb, flags, RM56);        ims, eptrb, flags, RM56);
735      if (rrc != MATCH_NOMATCH) RRETURN(rrc);      if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);
736      md->mark = ecode + 2;      md->mark = ecode + 2;
737      RRETURN(MATCH_PRUNE);      RRETURN(MATCH_PRUNE);
738    
739        /* SKIP overrides PRUNE and THEN */
740    
741      case OP_SKIP:      case OP_SKIP:
742      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
743        ims, eptrb, flags, RM53);        ims, eptrb, flags, RM53);
744      if (rrc != MATCH_NOMATCH) RRETURN(rrc);      if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN)
745          RRETURN(rrc);
746      md->start_match_ptr = eptr;   /* Pass back current position */      md->start_match_ptr = eptr;   /* Pass back current position */
747      MRRETURN(MATCH_SKIP);      MRRETURN(MATCH_SKIP);
748    
749      case OP_SKIP_ARG:      case OP_SKIP_ARG:
750      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,
751        ims, eptrb, flags, RM57);        ims, eptrb, flags, RM57);
752      if (rrc != MATCH_NOMATCH) RRETURN(rrc);      if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN)
753          RRETURN(rrc);
754    
755      /* Pass back the current skip name by overloading md->start_match_ptr and      /* Pass back the current skip name by overloading md->start_match_ptr and
756      returning the special MATCH_SKIP_ARG return code. This will either be      returning the special MATCH_SKIP_ARG return code. This will either be
# Line 745  for (;;) Line 759  for (;;)
759    
760      md->start_match_ptr = ecode + 2;      md->start_match_ptr = ecode + 2;
761      RRETURN(MATCH_SKIP_ARG);      RRETURN(MATCH_SKIP_ARG);
762    
763        /* For THEN (and THEN_ARG) we pass back the address of the bracket or
764        the alt that is at the start of the current branch. This makes it possible
765        to skip back past alternatives that precede the THEN within the current
766        branch. */
767    
768      case OP_THEN:      case OP_THEN:
769      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
770        ims, eptrb, flags, RM54);        ims, eptrb, flags, RM54);
771      if (rrc != MATCH_NOMATCH) RRETURN(rrc);      if (rrc != MATCH_NOMATCH) RRETURN(rrc);
772        md->start_match_ptr = ecode - GET(ecode, 1);
773      MRRETURN(MATCH_THEN);      MRRETURN(MATCH_THEN);
774    
775      case OP_THEN_ARG:      case OP_THEN_ARG:
776      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md,      RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1+LINK_SIZE],
777        ims, eptrb, flags, RM58);        offset_top, md, ims, eptrb, flags, RM58);
778      if (rrc != MATCH_NOMATCH) RRETURN(rrc);      if (rrc != MATCH_NOMATCH) RRETURN(rrc);
779      md->mark = ecode + 2;      md->start_match_ptr = ecode - GET(ecode, 1);
780        md->mark = ecode + LINK_SIZE + 2;
781      RRETURN(MATCH_THEN);      RRETURN(MATCH_THEN);
782    
783      /* Handle a capturing bracket. If there is space in the offset vector, save      /* Handle a capturing bracket. If there is space in the offset vector, save
# Line 793  for (;;) Line 814  for (;;)
814        save_capture_last = md->capture_last;        save_capture_last = md->capture_last;
815    
816        DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3));        DPRINTF(("saving %d %d %d\n", save_offset1, save_offset2, save_offset3));
817        md->offset_vector[md->offset_end - number] = eptr - md->start_subject;        md->offset_vector[md->offset_end - number] =
818            (int)(eptr - md->start_subject);
819    
820        flags = (op == OP_SCBRA)? match_cbegroup : 0;        flags = (op == OP_SCBRA)? match_cbegroup : 0;
821        do        do
822          {          {
823          RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,          RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md,
824            ims, eptrb, flags, RM1);            ims, eptrb, flags, RM1);
825          if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);          if (rrc != MATCH_NOMATCH &&
826                (rrc != MATCH_THEN || md->start_match_ptr != ecode))
827              RRETURN(rrc);
828          md->capture_last = save_capture_last;          md->capture_last = save_capture_last;
829          ecode += GET(ecode, 1);          ecode += GET(ecode, 1);
830          }          }
# Line 861  for (;;) Line 885  for (;;)
885    
886        RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims,        RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims,
887          eptrb, flags, RM2);          eptrb, flags, RM2);
888        if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);        if (rrc != MATCH_NOMATCH &&
889              (rrc != MATCH_THEN || md->start_match_ptr != ecode))
890            RRETURN(rrc);
891        ecode += GET(ecode, 1);        ecode += GET(ecode, 1);
892        }        }
893      /* Control never reaches here. */      /* Control never reaches here. */
# Line 888  for (;;) Line 914  for (;;)
914          cb.callout_number   = ecode[LINK_SIZE+2];          cb.callout_number   = ecode[LINK_SIZE+2];
915          cb.offset_vector    = md->offset_vector;          cb.offset_vector    = md->offset_vector;
916          cb.subject          = (PCRE_SPTR)md->start_subject;          cb.subject          = (PCRE_SPTR)md->start_subject;
917          cb.subject_length   = md->end_subject - md->start_subject;          cb.subject_length   = (int)(md->end_subject - md->start_subject);
918          cb.start_match      = mstart - md->start_subject;          cb.start_match      = (int)(mstart - md->start_subject);
919          cb.current_position = eptr - md->start_subject;          cb.current_position = (int)(eptr - md->start_subject);
920          cb.pattern_position = GET(ecode, LINK_SIZE + 3);          cb.pattern_position = GET(ecode, LINK_SIZE + 3);
921          cb.next_item_length = GET(ecode, 3 + 2*LINK_SIZE);          cb.next_item_length = GET(ecode, 3 + 2*LINK_SIZE);
922          cb.capture_top      = offset_top/2;          cb.capture_top      = offset_top/2;
# Line 1062  for (;;) Line 1088  for (;;)
1088          ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE + 2);          ecode += 1 + LINK_SIZE + GET(ecode, LINK_SIZE + 2);
1089          while (*ecode == OP_ALT) ecode += GET(ecode, 1);          while (*ecode == OP_ALT) ecode += GET(ecode, 1);
1090          }          }
1091        else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN)        else if (rrc != MATCH_NOMATCH &&
1092                  (rrc != MATCH_THEN || md->start_match_ptr != ecode))
1093          {          {
1094          RRETURN(rrc);         /* Need braces because of following else */          RRETURN(rrc);         /* Need braces because of following else */
1095          }          }
# Line 1116  for (;;) Line 1143  for (;;)
1143        {        {
1144        md->offset_vector[offset] =        md->offset_vector[offset] =
1145          md->offset_vector[md->offset_end - number];          md->offset_vector[md->offset_end - number];
1146        md->offset_vector[offset+1] = eptr - md->start_subject;        md->offset_vector[offset+1] = (int)(eptr - md->start_subject);
1147        if (offset_top <= offset) offset_top = offset + 2;        if (offset_top <= offset) offset_top = offset + 2;
1148        }        }
1149      ecode += 3;      ecode += 3;
# Line 1190  for (;;) Line 1217  for (;;)
1217          mstart = md->start_match_ptr;   /* In case \K reset it */          mstart = md->start_match_ptr;   /* In case \K reset it */
1218          break;          break;
1219          }          }
1220        if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);        if (rrc != MATCH_NOMATCH &&
1221              (rrc != MATCH_THEN || md->start_match_ptr != ecode))
1222            RRETURN(rrc);
1223        ecode += GET(ecode, 1);        ecode += GET(ecode, 1);
1224        }        }
1225      while (*ecode == OP_ALT);      while (*ecode == OP_ALT);
# Line 1224  for (;;) Line 1253  for (;;)
1253          do ecode += GET(ecode,1); while (*ecode == OP_ALT);          do ecode += GET(ecode,1); while (*ecode == OP_ALT);
1254          break;          break;
1255          }          }
1256        if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);        if (rrc != MATCH_NOMATCH &&
1257              (rrc != MATCH_THEN || md->start_match_ptr != ecode))
1258            RRETURN(rrc);
1259        ecode += GET(ecode,1);        ecode += GET(ecode,1);
1260        }        }
1261      while (*ecode == OP_ALT);      while (*ecode == OP_ALT);
# Line 1279  for (;;) Line 1310  for (;;)
1310        cb.callout_number   = ecode[1];        cb.callout_number   = ecode[1];
1311        cb.offset_vector    = md->offset_vector;        cb.offset_vector    = md->offset_vector;
1312        cb.subject          = (PCRE_SPTR)md->start_subject;        cb.subject          = (PCRE_SPTR)md->start_subject;
1313        cb.subject_length   = md->end_subject - md->start_subject;        cb.subject_length   = (int)(md->end_subject - md->start_subject);
1314        cb.start_match      = mstart - md->start_subject;        cb.start_match      = (int)(mstart - md->start_subject);
1315        cb.current_position = eptr - md->start_subject;        cb.current_position = (int)(eptr - md->start_subject);
1316        cb.pattern_position = GET(ecode, 2);        cb.pattern_position = GET(ecode, 2);
1317        cb.next_item_length = GET(ecode, 2 + LINK_SIZE);        cb.next_item_length = GET(ecode, 2 + LINK_SIZE);
1318        cb.capture_top      = offset_top/2;        cb.capture_top      = offset_top/2;
# Line 1361  for (;;) Line 1392  for (;;)
1392              (pcre_free)(new_recursive.offset_save);              (pcre_free)(new_recursive.offset_save);
1393            MRRETURN(MATCH_MATCH);            MRRETURN(MATCH_MATCH);
1394            }            }
1395          else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN)          else if (rrc != MATCH_NOMATCH &&
1396                    (rrc != MATCH_THEN || md->start_match_ptr != ecode))
1397            {            {
1398            DPRINTF(("Recursion gave error %d\n", rrc));            DPRINTF(("Recursion gave error %d\n", rrc));
1399            if (new_recursive.offset_save != stacksave)            if (new_recursive.offset_save != stacksave)
# Line 1404  for (;;) Line 1436  for (;;)
1436          mstart = md->start_match_ptr;          mstart = md->start_match_ptr;
1437          break;          break;
1438          }          }
1439        if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc);        if (rrc != MATCH_NOMATCH &&
1440              (rrc != MATCH_THEN || md->start_match_ptr != ecode))
1441            RRETURN(rrc);
1442        ecode += GET(ecode,1);        ecode += GET(ecode,1);
1443        }        }
1444      while (*ecode == OP_ALT);      while (*ecode == OP_ALT);
# Line 1558  for (;;) Line 1592  for (;;)
1592          {          {
1593          md->offset_vector[offset] =          md->offset_vector[offset] =
1594            md->offset_vector[md->offset_end - number];            md->offset_vector[md->offset_end - number];
1595          md->offset_vector[offset+1] = eptr - md->start_subject;          md->offset_vector[offset+1] = (int)(eptr - md->start_subject);
1596          if (offset_top <= offset) offset_top = offset + 2;          if (offset_top <= offset) offset_top = offset + 2;
1597          }          }
1598    
# Line 1718  for (;;) Line 1752  for (;;)
1752  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
1753        if (utf8)        if (utf8)
1754          {          {
1755            /* Get status of previous character */
1756    
1757          if (eptr == md->start_subject) prev_is_word = FALSE; else          if (eptr == md->start_subject) prev_is_word = FALSE; else
1758            {            {
1759            USPTR lastptr = eptr - 1;            USPTR lastptr = eptr - 1;
1760            while((*lastptr & 0xc0) == 0x80) lastptr--;            while((*lastptr & 0xc0) == 0x80) lastptr--;
1761            if (lastptr < md->start_used_ptr) md->start_used_ptr = lastptr;            if (lastptr < md->start_used_ptr) md->start_used_ptr = lastptr;
1762            GETCHAR(c, lastptr);            GETCHAR(c, lastptr);
1763    #ifdef SUPPORT_UCP
1764              if (md->use_ucp)
1765                {
1766                if (c == '_') prev_is_word = TRUE; else
1767                  {
1768                  int cat = UCD_CATEGORY(c);
1769                  prev_is_word = (cat == ucp_L || cat == ucp_N);
1770                  }
1771                }
1772              else
1773    #endif
1774            prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;            prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;
1775            }            }
1776    
1777            /* Get status of next character */
1778    
1779          if (eptr >= md->end_subject)          if (eptr >= md->end_subject)
1780            {            {
1781            SCHECK_PARTIAL();            SCHECK_PARTIAL();
# Line 1734  for (;;) Line 1784  for (;;)
1784          else          else
1785            {            {
1786            GETCHAR(c, eptr);            GETCHAR(c, eptr);
1787    #ifdef SUPPORT_UCP
1788              if (md->use_ucp)
1789                {
1790                if (c == '_') cur_is_word = TRUE; else
1791                  {
1792                  int cat = UCD_CATEGORY(c);
1793                  cur_is_word = (cat == ucp_L || cat == ucp_N);
1794                  }
1795                }
1796              else
1797    #endif
1798            cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;            cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0;
1799            }            }
1800          }          }
1801        else        else
1802  #endif  #endif
1803    
1804        /* Not in UTF-8 mode */        /* Not in UTF-8 mode, but we may still have PCRE_UCP set, and for
1805          consistency with the behaviour of \w we do use it in this case. */
1806    
1807          {          {
1808            /* Get status of previous character */
1809    
1810          if (eptr == md->start_subject) prev_is_word = FALSE; else          if (eptr == md->start_subject) prev_is_word = FALSE; else
1811            {            {
1812            if (eptr <= md->start_used_ptr) md->start_used_ptr = eptr - 1;            if (eptr <= md->start_used_ptr) md->start_used_ptr = eptr - 1;
1813    #ifdef SUPPORT_UCP
1814              if (md->use_ucp)
1815                {
1816                c = eptr[-1];
1817                if (c == '_') prev_is_word = TRUE; else
1818                  {
1819                  int cat = UCD_CATEGORY(c);
1820                  prev_is_word = (cat == ucp_L || cat == ucp_N);
1821                  }
1822                }
1823              else
1824    #endif
1825            prev_is_word = ((md->ctypes[eptr[-1]] & ctype_word) != 0);            prev_is_word = ((md->ctypes[eptr[-1]] & ctype_word) != 0);
1826            }            }
1827    
1828            /* Get status of next character */
1829    
1830          if (eptr >= md->end_subject)          if (eptr >= md->end_subject)
1831            {            {
1832            SCHECK_PARTIAL();            SCHECK_PARTIAL();
1833            cur_is_word = FALSE;            cur_is_word = FALSE;
1834            }            }
1835          else cur_is_word = ((md->ctypes[*eptr] & ctype_word) != 0);          else
1836    #ifdef SUPPORT_UCP
1837            if (md->use_ucp)
1838              {
1839              c = *eptr;
1840              if (c == '_') cur_is_word = TRUE; else
1841                {
1842                int cat = UCD_CATEGORY(c);
1843                cur_is_word = (cat == ucp_L || cat == ucp_N);
1844                }
1845              }
1846            else
1847    #endif
1848            cur_is_word = ((md->ctypes[*eptr] & ctype_word) != 0);
1849          }          }
1850    
1851        /* Now see if the situation is what we want */        /* Now see if the situation is what we want */
# Line 2076  for (;;) Line 2168  for (;;)
2168          if ((ecode[2] != prop->script) == (op == OP_PROP))          if ((ecode[2] != prop->script) == (op == OP_PROP))
2169            MRRETURN(MATCH_NOMATCH);            MRRETURN(MATCH_NOMATCH);
2170          break;          break;
2171    
2172          /* These are specials */          /* These are specials */
2173    
2174          case PT_ALNUM:          case PT_ALNUM:
2175          if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||          if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||
2176               _pcre_ucp_gentype[prop->chartype] == ucp_N) == (op == OP_NOTPROP))               _pcre_ucp_gentype[prop->chartype] == ucp_N) == (op == OP_NOTPROP))
2177            MRRETURN(MATCH_NOMATCH);            MRRETURN(MATCH_NOMATCH);
2178          break;          break;
2179    
2180          case PT_SPACE:    /* Perl space */          case PT_SPACE:    /* Perl space */
2181          if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||          if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
2182               c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR)               c == CHAR_HT || c == CHAR_NL || c == CHAR_FF || c == CHAR_CR)
2183                 == (op == OP_NOTPROP))                 == (op == OP_NOTPROP))
2184            MRRETURN(MATCH_NOMATCH);            MRRETURN(MATCH_NOMATCH);
2185          break;          break;
2186    
2187          case PT_PXSPACE:  /* POSIX space */          case PT_PXSPACE:  /* POSIX space */
2188          if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||          if ((_pcre_ucp_gentype[prop->chartype] == ucp_Z ||
2189               c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||               c == CHAR_HT || c == CHAR_NL || c == CHAR_VT ||
2190               c == CHAR_FF || c == CHAR_CR)               c == CHAR_FF || c == CHAR_CR)
2191                 == (op == OP_NOTPROP))                 == (op == OP_NOTPROP))
2192            MRRETURN(MATCH_NOMATCH);            MRRETURN(MATCH_NOMATCH);
2193          break;          break;
2194    
2195          case PT_WORD:          case PT_WORD:
2196          if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||          if ((_pcre_ucp_gentype[prop->chartype] == ucp_L ||
2197               _pcre_ucp_gentype[prop->chartype] == ucp_N ||               _pcre_ucp_gentype[prop->chartype] == ucp_N ||
2198               c == CHAR_UNDERSCORE) == (op == OP_NOTPROP))               c == CHAR_UNDERSCORE) == (op == OP_NOTPROP))
2199            MRRETURN(MATCH_NOMATCH);            MRRETURN(MATCH_NOMATCH);
2200          break;          break;
2201    
2202          /* This should never occur */          /* This should never occur */
2203    
2204          default:          default:
# Line 2174  for (;;) Line 2266  for (;;)
2266        referenced subpattern. */        referenced subpattern. */
2267    
2268        if (offset >= offset_top || md->offset_vector[offset] < 0)        if (offset >= offset_top || md->offset_vector[offset] < 0)
2269          length = (md->jscript_compat)? 0 : md->end_subject - eptr + 1;          length = (md->jscript_compat)? 0 : (int)(md->end_subject - eptr + 1);
2270        else        else
2271          length = md->offset_vector[offset+1] - md->offset_vector[offset];          length = md->offset_vector[offset+1] - md->offset_vector[offset];
2272    
# Line 3524  for (;;) Line 3616  for (;;)
3616                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
3617              }              }
3618            break;            break;
3619    
3620            case PT_ALNUM:            case PT_ALNUM:
3621            for (i = 1; i <= min; i++)            for (i = 1; i <= min; i++)
3622              {              {
# Line 3534  for (;;) Line 3626  for (;;)
3626                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
3627                }                }
3628              GETCHARINCTEST(c, eptr);              GETCHARINCTEST(c, eptr);
3629              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
3630              if ((prop_category == ucp_L || prop_category == ucp_N)              if ((prop_category == ucp_L || prop_category == ucp_N)
3631                     == prop_fail_result)                     == prop_fail_result)
3632                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
3633              }              }
3634            break;            break;
3635    
3636            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
3637            for (i = 1; i <= min; i++)            for (i = 1; i <= min; i++)
3638              {              {
# Line 3550  for (;;) Line 3642  for (;;)
3642                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
3643                }                }
3644              GETCHARINCTEST(c, eptr);              GETCHARINCTEST(c, eptr);
3645              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
3646              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||
3647                   c == CHAR_FF || c == CHAR_CR)                   c == CHAR_FF || c == CHAR_CR)
3648                     == prop_fail_result)                     == prop_fail_result)
3649                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
3650              }              }
3651            break;            break;
3652    
3653            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
3654            for (i = 1; i <= min; i++)            for (i = 1; i <= min; i++)
3655              {              {
# Line 3567  for (;;) Line 3659  for (;;)
3659                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
3660                }                }
3661              GETCHARINCTEST(c, eptr);              GETCHARINCTEST(c, eptr);
3662              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
3663              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||
3664                   c == CHAR_VT || c == CHAR_FF || c == CHAR_CR)                   c == CHAR_VT || c == CHAR_FF || c == CHAR_CR)
3665                     == prop_fail_result)                     == prop_fail_result)
3666                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
3667              }              }
3668            break;            break;
3669    
3670            case PT_WORD:            case PT_WORD:
3671            for (i = 1; i <= min; i++)            for (i = 1; i <= min; i++)
3672              {              {
3673              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
# Line 3584  for (;;) Line 3676  for (;;)
3676                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
3677                }                }
3678              GETCHARINCTEST(c, eptr);              GETCHARINCTEST(c, eptr);
3679              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
3680              if ((prop_category == ucp_L || prop_category == ucp_N ||              if ((prop_category == ucp_L || prop_category == ucp_N ||
3681                   c == CHAR_UNDERSCORE)                   c == CHAR_UNDERSCORE)
3682                     == prop_fail_result)                     == prop_fail_result)
3683                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
3684              }              }
3685            break;            break;
3686    
3687            /* This should not occur */            /* This should not occur */
3688    
3689            default:            default:
# Line 4154  for (;;) Line 4246  for (;;)
4246                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4247                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4248                }                }
4249              GETCHARINC(c, eptr);              GETCHARINCTEST(c, eptr);
4250              if (prop_fail_result) MRRETURN(MATCH_NOMATCH);              if (prop_fail_result) MRRETURN(MATCH_NOMATCH);
4251              }              }
4252            /* Control never gets here */            /* Control never gets here */
# Line 4170  for (;;) Line 4262  for (;;)
4262                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4263                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4264                }                }
4265              GETCHARINC(c, eptr);              GETCHARINCTEST(c, eptr);
4266              prop_chartype = UCD_CHARTYPE(c);              prop_chartype = UCD_CHARTYPE(c);
4267              if ((prop_chartype == ucp_Lu ||              if ((prop_chartype == ucp_Lu ||
4268                   prop_chartype == ucp_Ll ||                   prop_chartype == ucp_Ll ||
# Line 4190  for (;;) Line 4282  for (;;)
4282                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4283                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4284                }                }
4285              GETCHARINC(c, eptr);              GETCHARINCTEST(c, eptr);
4286              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4287              if ((prop_category == prop_value) == prop_fail_result)              if ((prop_category == prop_value) == prop_fail_result)
4288                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
# Line 4208  for (;;) Line 4300  for (;;)
4300                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4301                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4302                }                }
4303              GETCHARINC(c, eptr);              GETCHARINCTEST(c, eptr);
4304              prop_chartype = UCD_CHARTYPE(c);              prop_chartype = UCD_CHARTYPE(c);
4305              if ((prop_chartype == prop_value) == prop_fail_result)              if ((prop_chartype == prop_value) == prop_fail_result)
4306                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
# Line 4226  for (;;) Line 4318  for (;;)
4318                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4319                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4320                }                }
4321              GETCHARINC(c, eptr);              GETCHARINCTEST(c, eptr);
4322              prop_script = UCD_SCRIPT(c);              prop_script = UCD_SCRIPT(c);
4323              if ((prop_script == prop_value) == prop_fail_result)              if ((prop_script == prop_value) == prop_fail_result)
4324                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
# Line 4236  for (;;) Line 4328  for (;;)
4328            case PT_ALNUM:            case PT_ALNUM:
4329            for (fi = min;; fi++)            for (fi = min;; fi++)
4330              {              {
4331              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39);              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM59);
4332              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
4333              if (fi >= max) MRRETURN(MATCH_NOMATCH);              if (fi >= max) MRRETURN(MATCH_NOMATCH);
4334              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
# Line 4244  for (;;) Line 4336  for (;;)
4336                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4337                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4338                }                }
4339              GETCHARINC(c, eptr);              GETCHARINCTEST(c, eptr);
4340              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4341              if ((prop_category == ucp_L || prop_category == ucp_N)              if ((prop_category == ucp_L || prop_category == ucp_N)
4342                     == prop_fail_result)                     == prop_fail_result)
4343                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4344              }              }
4345            /* Control never gets here */            /* Control never gets here */
4346    
4347            case PT_SPACE:    /* Perl space */            case PT_SPACE:    /* Perl space */
4348            for (fi = min;; fi++)            for (fi = min;; fi++)
4349              {              {
4350              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39);              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM60);
4351              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
4352              if (fi >= max) MRRETURN(MATCH_NOMATCH);              if (fi >= max) MRRETURN(MATCH_NOMATCH);
4353              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
# Line 4263  for (;;) Line 4355  for (;;)
4355                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4356                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4357                }                }
4358              GETCHARINC(c, eptr);              GETCHARINCTEST(c, eptr);
4359              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4360              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||
4361                   c == CHAR_FF || c == CHAR_CR)                   c == CHAR_FF || c == CHAR_CR)
4362                     == prop_fail_result)                     == prop_fail_result)
4363                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4364              }              }
4365            /* Control never gets here */            /* Control never gets here */
4366    
4367            case PT_PXSPACE:  /* POSIX space */            case PT_PXSPACE:  /* POSIX space */
4368            for (fi = min;; fi++)            for (fi = min;; fi++)
4369              {              {
4370              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39);              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM61);
4371              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
4372              if (fi >= max) MRRETURN(MATCH_NOMATCH);              if (fi >= max) MRRETURN(MATCH_NOMATCH);
4373              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
# Line 4283  for (;;) Line 4375  for (;;)
4375                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4376                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4377                }                }
4378              GETCHARINC(c, eptr);              GETCHARINCTEST(c, eptr);
4379              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4380              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||
4381                   c == CHAR_VT || c == CHAR_FF || c == CHAR_CR)                   c == CHAR_VT || c == CHAR_FF || c == CHAR_CR)
4382                     == prop_fail_result)                     == prop_fail_result)
4383                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4384              }              }
4385            /* Control never gets here */            /* Control never gets here */
4386    
4387            case PT_WORD:            case PT_WORD:
4388            for (fi = min;; fi++)            for (fi = min;; fi++)
4389              {              {
4390              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39);              RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM62);
4391              if (rrc != MATCH_NOMATCH) RRETURN(rrc);              if (rrc != MATCH_NOMATCH) RRETURN(rrc);
4392              if (fi >= max) MRRETURN(MATCH_NOMATCH);              if (fi >= max) MRRETURN(MATCH_NOMATCH);
4393              if (eptr >= md->end_subject)              if (eptr >= md->end_subject)
# Line 4303  for (;;) Line 4395  for (;;)
4395                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4396                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4397                }                }
4398              GETCHARINC(c, eptr);              GETCHARINCTEST(c, eptr);
4399              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4400              if ((prop_category == ucp_L ||              if ((prop_category == ucp_L ||
4401                   prop_category == ucp_N ||                   prop_category == ucp_N ||
4402                   c == CHAR_UNDERSCORE)                   c == CHAR_UNDERSCORE)
4403                     == prop_fail_result)                     == prop_fail_result)
4404                MRRETURN(MATCH_NOMATCH);                MRRETURN(MATCH_NOMATCH);
4405              }              }
4406            /* Control never gets here */            /* Control never gets here */
4407    
4408            /* This should never occur */            /* This should never occur */
4409    
4410            default:            default:
4411            RRETURN(PCRE_ERROR_INTERNAL);            RRETURN(PCRE_ERROR_INTERNAL);
4412            }            }
# Line 4661  for (;;) Line 4753  for (;;)
4753                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4754                break;                break;
4755                }                }
4756              GETCHARLEN(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
4757              if (prop_fail_result) break;              if (prop_fail_result) break;
4758              eptr+= len;              eptr+= len;
4759              }              }
# Line 4676  for (;;) Line 4768  for (;;)
4768                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4769                break;                break;
4770                }                }
4771              GETCHARLEN(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
4772              prop_chartype = UCD_CHARTYPE(c);              prop_chartype = UCD_CHARTYPE(c);
4773              if ((prop_chartype == ucp_Lu ||              if ((prop_chartype == ucp_Lu ||
4774                   prop_chartype == ucp_Ll ||                   prop_chartype == ucp_Ll ||
# Line 4695  for (;;) Line 4787  for (;;)
4787                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4788                break;                break;
4789                }                }
4790              GETCHARLEN(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
4791              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4792              if ((prop_category == prop_value) == prop_fail_result)              if ((prop_category == prop_value) == prop_fail_result)
4793                break;                break;
# Line 4712  for (;;) Line 4804  for (;;)
4804                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4805                break;                break;
4806                }                }
4807              GETCHARLEN(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
4808              prop_chartype = UCD_CHARTYPE(c);              prop_chartype = UCD_CHARTYPE(c);
4809              if ((prop_chartype == prop_value) == prop_fail_result)              if ((prop_chartype == prop_value) == prop_fail_result)
4810                break;                break;
# Line 4729  for (;;) Line 4821  for (;;)
4821                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4822                break;                break;
4823                }                }
4824              GETCHARLEN(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
4825              prop_script = UCD_SCRIPT(c);              prop_script = UCD_SCRIPT(c);
4826              if ((prop_script == prop_value) == prop_fail_result)              if ((prop_script == prop_value) == prop_fail_result)
4827                break;                break;
4828              eptr+= len;              eptr+= len;
4829              }              }
4830            break;            break;
4831    
4832            case PT_ALNUM:            case PT_ALNUM:
4833            for (i = min; i < max; i++)            for (i = min; i < max; i++)
4834              {              {
# Line 4746  for (;;) Line 4838  for (;;)
4838                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4839                break;                break;
4840                }                }
4841              GETCHARLEN(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
4842              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4843              if ((prop_category == ucp_L || prop_category == ucp_N)              if ((prop_category == ucp_L || prop_category == ucp_N)
4844                   == prop_fail_result)                   == prop_fail_result)
4845                break;                break;
4846              eptr+= len;              eptr+= len;
# Line 4764  for (;;) Line 4856  for (;;)
4856                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4857                break;                break;
4858                }                }
4859              GETCHARLEN(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
4860              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4861              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||
4862                   c == CHAR_FF || c == CHAR_CR)                   c == CHAR_FF || c == CHAR_CR)
4863                   == prop_fail_result)                   == prop_fail_result)
4864                break;                break;
4865              eptr+= len;              eptr+= len;
# Line 4783  for (;;) Line 4875  for (;;)
4875                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4876                break;                break;
4877                }                }
4878              GETCHARLEN(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
4879              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4880              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||              if ((prop_category == ucp_Z || c == CHAR_HT || c == CHAR_NL ||
4881                   c == CHAR_VT || c == CHAR_FF || c == CHAR_CR)                   c == CHAR_VT || c == CHAR_FF || c == CHAR_CR)
4882                   == prop_fail_result)                   == prop_fail_result)
4883                break;                break;
4884              eptr+= len;              eptr+= len;
# Line 4802  for (;;) Line 4894  for (;;)
4894                SCHECK_PARTIAL();                SCHECK_PARTIAL();
4895                break;                break;
4896                }                }
4897              GETCHARLEN(c, eptr, len);              GETCHARLENTEST(c, eptr, len);
4898              prop_category = UCD_CATEGORY(c);              prop_category = UCD_CATEGORY(c);
4899              if ((prop_category == ucp_L || prop_category == ucp_N ||              if ((prop_category == ucp_L || prop_category == ucp_N ||
4900                   c == CHAR_UNDERSCORE) == prop_fail_result)                   c == CHAR_UNDERSCORE) == prop_fail_result)
# Line 5404  switch (frame->Xwhere) Line 5496  switch (frame->Xwhere)
5496    LBL(32) LBL(34) LBL(42) LBL(46)    LBL(32) LBL(34) LBL(42) LBL(46)
5497  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
5498    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)
5499      LBL(59) LBL(60) LBL(61) LBL(62)
5500  #endif  /* SUPPORT_UCP */  #endif  /* SUPPORT_UCP */
5501  #endif  /* SUPPORT_UTF8 */  #endif  /* SUPPORT_UTF8 */
5502    default:    default:
# Line 5607  end_subject = md->end_subject; Line 5700  end_subject = md->end_subject;
5700    
5701  md->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;  md->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;
5702  utf8 = md->utf8 = (re->options & PCRE_UTF8) != 0;  utf8 = md->utf8 = (re->options & PCRE_UTF8) != 0;
5703    md->use_ucp = (re->options & PCRE_UCP) != 0;
5704  md->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;  md->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;
5705    
5706  md->notbol = (options & PCRE_NOTBOL) != 0;  md->notbol = (options & PCRE_NOTBOL) != 0;
# Line 5895  for(;;) Line 5989  for(;;)
5989        while (start_match < end_subject)        while (start_match < end_subject)
5990          {          {
5991          register unsigned int c = *start_match;          register unsigned int c = *start_match;
5992          if ((start_bits[c/8] & (1 << (c&7))) == 0) start_match++;          if ((start_bits[c/8] & (1 << (c&7))) == 0)
5993            else break;            {
5994              start_match++;
5995    #ifdef SUPPORT_UTF8
5996              if (utf8)
5997                while(start_match < end_subject && (*start_match & 0xc0) == 0x80)
5998                  start_match++;
5999    #endif
6000              }
6001            else break;
6002          }          }
6003        }        }
6004      }   /* Starting optimizations */      }   /* Starting optimizations */
# Line 5997  for(;;) Line 6099  for(;;)
6099    
6100    switch(rc)    switch(rc)
6101      {      {
6102      /* NOMATCH and PRUNE advance by one character. If MATCH_SKIP_ARG reaches      /* SKIP passes back the next starting point explicitly, but if it is the
6103      this level it means that a MARK that matched the SKIP's arg was not found.      same as the match we have just done, treat it as NOMATCH. */
6104      We treat this as NOMATCH. THEN at this level acts exactly like PRUNE. */  
6105        case MATCH_SKIP:
6106        if (md->start_match_ptr != start_match)
6107          {
6108          new_start_match = md->start_match_ptr;
6109          break;
6110          }
6111        /* Fall through */
6112    
6113        /* If MATCH_SKIP_ARG reaches this level it means that a MARK that matched
6114        the SKIP's arg was not found. We also treat this as NOMATCH. */
6115    
6116        case MATCH_SKIP_ARG:
6117        /* Fall through */
6118    
6119        /* NOMATCH and PRUNE advance by one character. THEN at this level acts
6120        exactly like PRUNE. */
6121    
6122      case MATCH_NOMATCH:      case MATCH_NOMATCH:
6123      case MATCH_PRUNE:      case MATCH_PRUNE:
     case MATCH_SKIP_ARG:  
6124      case MATCH_THEN:      case MATCH_THEN:
6125      new_start_match = start_match + 1;      new_start_match = start_match + 1;
6126  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
# Line 6013  for(;;) Line 6130  for(;;)
6130  #endif  #endif
6131      break;      break;
6132    
     /* SKIP passes back the next starting point explicitly. */  
   
     case MATCH_SKIP:  
     new_start_match = md->start_match_ptr;  
     break;  
   
6133      /* COMMIT disables the bumpalong, but otherwise behaves as NOMATCH. */      /* COMMIT disables the bumpalong, but otherwise behaves as NOMATCH. */
6134    
6135      case MATCH_COMMIT:      case MATCH_COMMIT:
# Line 6115  if (rc == MATCH_MATCH || rc == MATCH_ACC Line 6226  if (rc == MATCH_MATCH || rc == MATCH_ACC
6226    
6227    if (offsetcount < 2) rc = 0; else    if (offsetcount < 2) rc = 0; else
6228      {      {
6229      offsets[0] = md->start_match_ptr - md->start_subject;      offsets[0] = (int)(md->start_match_ptr - md->start_subject);
6230      offsets[1] = md->end_match_ptr - md->start_subject;      offsets[1] = (int)(md->end_match_ptr - md->start_subject);
6231      }      }
6232    
6233    DPRINTF((">>>> returning %d\n", rc));    DPRINTF((">>>> returning %d\n", rc));
# Line 6148  if (start_partial != NULL) Line 6259  if (start_partial != NULL)
6259    md->mark = NULL;    md->mark = NULL;
6260    if (offsetcount > 1)    if (offsetcount > 1)
6261      {      {
6262      offsets[0] = start_partial - (USPTR)subject;      offsets[0] = (int)(start_partial - (USPTR)subject);
6263      offsets[1] = end_subject - (USPTR)subject;      offsets[1] = (int)(end_subject - (USPTR)subject);
6264      }      }
6265    rc = PCRE_ERROR_PARTIAL;    rc = PCRE_ERROR_PARTIAL;
6266    }    }

Legend:
Removed from v.517  
changed lines
  Added in v.551

  ViewVC Help
Powered by ViewVC 1.1.5