/[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 1248 by ph10, Wed Feb 13 17:36:38 2013 UTC revision 1274 by ph10, Fri Mar 8 11:35:41 2013 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-2012 University of Cambridge             Copyright (c) 1997-2013 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 56  possible. There are also some static sup Line 56  possible. There are also some static sup
56  #undef min  #undef min
57  #undef max  #undef max
58    
59  /* The md->capture_last field uses the lower 16 bits for the last captured  /* The md->capture_last field uses the lower 16 bits for the last captured
60  substring (which can never be greater than 65535) and a bit in the top half  substring (which can never be greater than 65535) and a bit in the top half
61  to mean "capture vector overflowed". This odd way of doing things was  to mean "capture vector overflowed". This odd way of doing things was
62  implemented when it was realized that preserving and restoring the overflow bit  implemented when it was realized that preserving and restoring the overflow bit
63  whenever the last capture number was saved/restored made for a neater  whenever the last capture number was saved/restored made for a neater
64  interface, and doing it this way saved on (a) another variable, which would  interface, and doing it this way saved on (a) another variable, which would
65  have increased the stack frame size (a big NO-NO in PCRE) and (b) another  have increased the stack frame size (a big NO-NO in PCRE) and (b) another
66  separate set of save/restore instructions. The following defines are used in  separate set of save/restore instructions. The following defines are used in
67  implementing this. */  implementing this. */
68    
69  #define CAPLMASK    0x0000ffff    /* The bits used for last_capture */  #define CAPLMASK    0x0000ffff    /* The bits used for last_capture */
# Line 87  defined PCRE_ERROR_xxx codes, which are Line 87  defined PCRE_ERROR_xxx codes, which are
87  negative to avoid the external error codes. */  negative to avoid the external error codes. */
88    
89  #define MATCH_ACCEPT       (-999)  #define MATCH_ACCEPT       (-999)
90  #define MATCH_COMMIT       (-998)  #define MATCH_KETRPOS      (-998)
91  #define MATCH_KETRPOS      (-997)  #define MATCH_ONCE         (-997)
92  #define MATCH_ONCE         (-996)  /* The next 5 must be kept together and in sequence so that a test that checks
93    for any one of them can use a range. */
94    #define MATCH_COMMIT       (-996)
95  #define MATCH_PRUNE        (-995)  #define MATCH_PRUNE        (-995)
96  #define MATCH_SKIP         (-994)  #define MATCH_SKIP         (-994)
97  #define MATCH_SKIP_ARG     (-993)  #define MATCH_SKIP_ARG     (-993)
98  #define MATCH_THEN         (-992)  #define MATCH_THEN         (-992)
99    #define MATCH_BACKTRACK_MAX MATCH_THEN
100    #define MATCH_BACKTRACK_MIN MATCH_COMMIT
101    
102  /* Maximum number of ints of offset to save on the stack for recursive calls.  /* Maximum number of ints of offset to save on the stack for recursive calls.
103  If the offset vector is bigger, malloc is used. This should be a multiple of 3,  If the offset vector is bigger, malloc is used. This should be a multiple of 3,
# Line 233  if (caseless) Line 237  if (caseless)
237      {      {
238      while (length-- > 0)      while (length-- > 0)
239        {        {
240        pcre_uchar cc, cp;        pcre_uint32 cc, cp;
241        if (eptr >= md->end_subject) return -2;   /* Partial match */        if (eptr >= md->end_subject) return -2;   /* Partial match */
242        cc = RAWUCHARTEST(eptr);        cc = RAWUCHARTEST(eptr);
243        cp = RAWUCHARTEST(p);        cp = RAWUCHARTEST(p);
# Line 308  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM Line 312  enum { RM1=1, RM2,  RM3,  RM4,  RM5,  RM
312         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,         RM31,  RM32, RM33, RM34, RM35, RM36, RM37, RM38, RM39, RM40,
313         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,         RM41,  RM42, RM43, RM44, RM45, RM46, RM47, RM48, RM49, RM50,
314         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,         RM51,  RM52, RM53, RM54, RM55, RM56, RM57, RM58, RM59, RM60,
315         RM61,  RM62, RM63, RM64, RM65, RM66, RM67 };         RM61,  RM62, RM63, RM64, RM65, RM66, RM67, RM68 };
316    
317  /* 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
318  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 817  for (;;) Line 821  for (;;)
821      RRETURN(MATCH_SKIP);      RRETURN(MATCH_SKIP);
822    
823      /* Note that, for Perl compatibility, SKIP with an argument does NOT set      /* Note that, for Perl compatibility, SKIP with an argument does NOT set
824      nomatch_mark. There is a flag that disables this opcode when re-matching a      nomatch_mark. When a pattern match ends with a SKIP_ARG for which there was
825      pattern that ended with a SKIP for which there was not a matching MARK. */      not a matching mark, we have to re-run the match, ignoring the SKIP_ARG
826        that failed and any that preceed it (either they also failed, or were not
827        triggered). To do this, we maintain a count of executed SKIP_ARGs. If a
828        SKIP_ARG gets to top level, the match is re-run with md->ignore_skip_arg
829        set to the count of the one that failed. */
830    
831      case OP_SKIP_ARG:      case OP_SKIP_ARG:
832      if (md->ignore_skip_arg)      md->skip_arg_count++;
833        if (md->skip_arg_count <= md->ignore_skip_arg)
834        {        {
835        ecode += PRIV(OP_lengths)[*ecode] + ecode[1];        ecode += PRIV(OP_lengths)[*ecode] + ecode[1];
836        break;        break;
# Line 830  for (;;) Line 839  for (;;)
839        eptrb, RM57);        eptrb, RM57);
840      if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN)      if (rrc != MATCH_NOMATCH && rrc != MATCH_PRUNE && rrc != MATCH_THEN)
841        RRETURN(rrc);        RRETURN(rrc);
842    
843      /* 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
844      returning the special MATCH_SKIP_ARG return code. This will either be      returning the special MATCH_SKIP_ARG return code. This will either be
845      caught by a matching MARK, or get to the top, where it causes a rematch      caught by a matching MARK, or get to the top, where it causes a rematch
846      with the md->ignore_skip_arg flag set. */      with md->ignore_skip_arg set to the value of md->skip_arg_count. */
847    
848      md->start_match_ptr = ecode + 2;      md->start_match_ptr = ecode + 2;
849      RRETURN(MATCH_SKIP_ARG);      RRETURN(MATCH_SKIP_ARG);
# Line 1310  for (;;) Line 1319  for (;;)
1319          cb.next_item_length = GET(ecode, 3 + 2*LINK_SIZE);          cb.next_item_length = GET(ecode, 3 + 2*LINK_SIZE);
1320          cb.capture_top      = offset_top/2;          cb.capture_top      = offset_top/2;
1321          cb.capture_last     = md->capture_last & CAPLMASK;          cb.capture_last     = md->capture_last & CAPLMASK;
1322          /* Internal change requires this for API compatibility. */          /* Internal change requires this for API compatibility. */
1323          if (cb.capture_last == 0) cb.capture_last = -1;          if (cb.capture_last == 0) cb.capture_last = -1;
1324          cb.callout_data     = md->callout_data;          cb.callout_data     = md->callout_data;
1325          cb.mark             = md->nomatch_mark;          cb.mark             = md->nomatch_mark;
1326          if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH);          if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH);
1327          if (rrc < 0) RRETURN(rrc);          if (rrc < 0) RRETURN(rrc);
1328          }          }
1329        ecode += PRIV(OP_lengths)[OP_CALLOUT];        ecode += PRIV(OP_lengths)[OP_CALLOUT];
1330          codelink -= PRIV(OP_lengths)[OP_CALLOUT];
1331        }        }
1332    
1333      condcode = ecode[LINK_SIZE+1];      condcode = ecode[LINK_SIZE+1];
# Line 1737  for (;;) Line 1747  for (;;)
1747        cb.next_item_length = GET(ecode, 2 + LINK_SIZE);        cb.next_item_length = GET(ecode, 2 + LINK_SIZE);
1748        cb.capture_top      = offset_top/2;        cb.capture_top      = offset_top/2;
1749        cb.capture_last     = md->capture_last & CAPLMASK;        cb.capture_last     = md->capture_last & CAPLMASK;
1750        /* Internal change requires this for API compatibility. */        /* Internal change requires this for API compatibility. */
1751        if (cb.capture_last == 0) cb.capture_last = -1;        if (cb.capture_last == 0) cb.capture_last = -1;
1752        cb.callout_data     = md->callout_data;        cb.callout_data     = md->callout_data;
1753        cb.mark             = md->nomatch_mark;        cb.mark             = md->nomatch_mark;
1754        if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH);        if ((rrc = (*PUBL(callout))(&cb)) > 0) RRETURN(MATCH_NOMATCH);
# Line 1784  for (;;) Line 1794  for (;;)
1794        /* Add to "recursing stack" */        /* Add to "recursing stack" */
1795    
1796        new_recursive.group_num = recno;        new_recursive.group_num = recno;
1797        new_recursive.saved_capture_last = md->capture_last;        new_recursive.saved_capture_last = md->capture_last;
1798        new_recursive.subject_position = eptr;        new_recursive.subject_position = eptr;
1799        new_recursive.prevrec = md->recursive;        new_recursive.prevrec = md->recursive;
1800        md->recursive = &new_recursive;        md->recursive = &new_recursive;
# Line 1821  for (;;) Line 1831  for (;;)
1831            md, eptrb, RM6);            md, eptrb, RM6);
1832          memcpy(md->offset_vector, new_recursive.offset_save,          memcpy(md->offset_vector, new_recursive.offset_save,
1833              new_recursive.saved_max * sizeof(int));              new_recursive.saved_max * sizeof(int));
1834          md->capture_last = new_recursive.saved_capture_last;          md->capture_last = new_recursive.saved_capture_last;
1835          md->recursive = new_recursive.prevrec;          md->recursive = new_recursive.prevrec;
1836          if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT)          if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT)
1837            {            {
# Line 1838  for (;;) Line 1848  for (;;)
1848            goto RECURSION_MATCHED;        /* Exit loop; end processing */            goto RECURSION_MATCHED;        /* Exit loop; end processing */
1849            }            }
1850    
1851          /* PCRE does not allow THEN or COMMIT to escape beyond a recursion; it          /* PCRE does not allow THEN, SKIP, PRUNE or COMMIT to escape beyond a
1852          is treated as NOMATCH. */          recursion; they are treated as NOMATCH. These codes are defined in a
1853            range that can be tested for. Any other return code is an error. */
1854    
1855          else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN &&          else if (rrc != MATCH_NOMATCH &&
1856                   rrc != MATCH_COMMIT)                   (rrc < MATCH_BACKTRACK_MIN || rrc > MATCH_BACKTRACK_MAX))
1857            {            {
1858            DPRINTF(("Recursion gave error %d\n", rrc));            DPRINTF(("Recursion gave error %d\n", rrc));
1859            if (new_recursive.offset_save != stacksave)            if (new_recursive.offset_save != stacksave)
# Line 2629  for (;;) Line 2640  for (;;)
2640            }            }
2641          break;          break;
2642    
2643            case PT_UCNC:
2644            if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
2645                 c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
2646                 c >= 0xe000) == (op == OP_NOTPROP))
2647              RRETURN(MATCH_NOMATCH);
2648            break;
2649    
2650          /* This should never occur */          /* This should never occur */
2651    
2652          default:          default:
# Line 3215  for (;;) Line 3233  for (;;)
3233    
3234        if (fc < 128)        if (fc < 128)
3235          {          {
3236          pcre_uchar cc = RAWUCHAR(eptr);          pcre_uint32 cc = RAWUCHAR(eptr);
3237          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);
3238          ecode++;          ecode++;
3239          eptr++;          eptr++;
# Line 4247  for (;;) Line 4265  for (;;)
4265              }              }
4266            break;            break;
4267    
4268              case PT_UCNC:
4269              for (i = 1; i <= min; i++)
4270                {
4271                if (eptr >= md->end_subject)
4272                  {
4273                  SCHECK_PARTIAL();
4274                  RRETURN(MATCH_NOMATCH);
4275                  }
4276                GETCHARINCTEST(c, eptr);
4277                if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
4278                     c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
4279                     c >= 0xe000) == prop_fail_result)
4280                  RRETURN(MATCH_NOMATCH);
4281                }
4282              break;
4283    
4284            /* This should not occur */            /* This should not occur */
4285    
4286            default:            default:
# Line 4452  for (;;) Line 4486  for (;;)
4486          case OP_DIGIT:          case OP_DIGIT:
4487          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4488            {            {
4489            pcre_uchar cc;            pcre_uint32 cc;
   
4490            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4491              {              {
4492              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4470  for (;;) Line 4503  for (;;)
4503          case OP_NOT_WHITESPACE:          case OP_NOT_WHITESPACE:
4504          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4505            {            {
4506            pcre_uchar cc;            pcre_uint32 cc;
   
4507            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4508              {              {
4509              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4488  for (;;) Line 4520  for (;;)
4520          case OP_WHITESPACE:          case OP_WHITESPACE:
4521          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4522            {            {
4523            pcre_uchar cc;            pcre_uint32 cc;
   
4524            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4525              {              {
4526              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4506  for (;;) Line 4537  for (;;)
4537          case OP_NOT_WORDCHAR:          case OP_NOT_WORDCHAR:
4538          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4539            {            {
4540            pcre_uchar cc;            pcre_uint32 cc;
   
4541            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4542              {              {
4543              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4524  for (;;) Line 4554  for (;;)
4554          case OP_WORDCHAR:          case OP_WORDCHAR:
4555          for (i = 1; i <= min; i++)          for (i = 1; i <= min; i++)
4556            {            {
4557            pcre_uchar cc;            pcre_uint32 cc;
   
4558            if (eptr >= md->end_subject)            if (eptr >= md->end_subject)
4559              {              {
4560              SCHECK_PARTIAL();              SCHECK_PARTIAL();
# Line 4998  for (;;) Line 5027  for (;;)
5027              }              }
5028            /* Control never gets here */            /* Control never gets here */
5029    
5030              case PT_UCNC:
5031              for (fi = min;; fi++)
5032                {
5033                RMATCH(eptr, ecode, offset_top, md, eptrb, RM68);
5034                if (rrc != MATCH_NOMATCH) RRETURN(rrc);
5035                if (fi >= max) RRETURN(MATCH_NOMATCH);
5036                if (eptr >= md->end_subject)
5037                  {
5038                  SCHECK_PARTIAL();
5039                  RRETURN(MATCH_NOMATCH);
5040                  }
5041                GETCHARINCTEST(c, eptr);
5042                if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
5043                     c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
5044                     c >= 0xe000) == prop_fail_result)
5045                  RRETURN(MATCH_NOMATCH);
5046                }
5047              /* Control never gets here */
5048    
5049            /* This should never occur */            /* This should never occur */
5050            default:            default:
5051            RRETURN(PCRE_ERROR_INTERNAL);            RRETURN(PCRE_ERROR_INTERNAL);
# Line 5492  for (;;) Line 5540  for (;;)
5540            GOT_MAX:            GOT_MAX:
5541            break;            break;
5542    
5543              case PT_UCNC:
5544              for (i = min; i < max; i++)
5545                {
5546                int len = 1;
5547                if (eptr >= md->end_subject)
5548                  {
5549                  SCHECK_PARTIAL();
5550                  break;
5551                  }
5552                GETCHARLENTEST(c, eptr, len);
5553                if ((c == CHAR_DOLLAR_SIGN || c == CHAR_COMMERCIAL_AT ||
5554                     c == CHAR_GRAVE_ACCENT || (c >= 0xa0 && c <= 0xd7ff) ||
5555                     c >= 0xe000) == prop_fail_result)
5556                  break;
5557                eptr += len;
5558                }
5559              break;
5560    
5561            default:            default:
5562            RRETURN(PCRE_ERROR_INTERNAL);            RRETURN(PCRE_ERROR_INTERNAL);
5563            }            }
# Line 6133  switch (frame->Xwhere) Line 6199  switch (frame->Xwhere)
6199    LBL(32) LBL(34) LBL(42) LBL(46)    LBL(32) LBL(34) LBL(42) LBL(46)
6200  #ifdef SUPPORT_UCP  #ifdef SUPPORT_UCP
6201    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)
6202    LBL(59) LBL(60) LBL(61) LBL(62) LBL(67)    LBL(59) LBL(60) LBL(61) LBL(62) LBL(67) LBL(68)
6203  #endif  /* SUPPORT_UCP */  #endif  /* SUPPORT_UCP */
6204  #endif  /* SUPPORT_UTF */  #endif  /* SUPPORT_UTF */
6205    default:    default:
# Line 6286  const pcre_uint8 *start_bits = NULL; Line 6352  const pcre_uint8 *start_bits = NULL;
6352  PCRE_PUCHAR start_match = (PCRE_PUCHAR)subject + start_offset;  PCRE_PUCHAR start_match = (PCRE_PUCHAR)subject + start_offset;
6353  PCRE_PUCHAR end_subject;  PCRE_PUCHAR end_subject;
6354  PCRE_PUCHAR start_partial = NULL;  PCRE_PUCHAR start_partial = NULL;
6355    PCRE_PUCHAR match_partial;
6356  PCRE_PUCHAR req_char_ptr = start_match - 1;  PCRE_PUCHAR req_char_ptr = start_match - 1;
6357    
6358  const pcre_study_data *study;  const pcre_study_data *study;
# Line 6454  end_subject = md->end_subject; Line 6521  end_subject = md->end_subject;
6521  md->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;  md->endonly = (re->options & PCRE_DOLLAR_ENDONLY) != 0;
6522  md->use_ucp = (re->options & PCRE_UCP) != 0;  md->use_ucp = (re->options & PCRE_UCP) != 0;
6523  md->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;  md->jscript_compat = (re->options & PCRE_JAVASCRIPT_COMPAT) != 0;
6524  md->ignore_skip_arg = FALSE;  md->ignore_skip_arg = 0;
6525    
6526  /* Some options are unpacked into BOOL variables in the hope that testing  /* Some options are unpacked into BOOL variables in the hope that testing
6527  them will be faster than individual option bits. */  them will be faster than individual option bits. */
# Line 6836  for(;;) Line 6903  for(;;)
6903    md->match_call_count = 0;    md->match_call_count = 0;
6904    md->match_function_type = 0;    md->match_function_type = 0;
6905    md->end_offset_top = 0;    md->end_offset_top = 0;
6906      md->skip_arg_count = 0;
6907    rc = match(start_match, md->start_code, start_match, 2, md, NULL, 0);    rc = match(start_match, md->start_code, start_match, 2, md, NULL, 0);
6908    if (md->hitend && start_partial == NULL) start_partial = md->start_used_ptr;    if (md->hitend && start_partial == NULL)
6909        {
6910        start_partial = md->start_used_ptr;
6911        match_partial = start_match;
6912        }
6913    
6914    switch(rc)    switch(rc)
6915      {      {
# Line 6850  for(;;) Line 6922  for(;;)
6922    
6923      case MATCH_SKIP_ARG:      case MATCH_SKIP_ARG:
6924      new_start_match = start_match;      new_start_match = start_match;
6925      md->ignore_skip_arg = TRUE;      md->ignore_skip_arg = md->skip_arg_count;
6926      break;      break;
6927    
6928      /* SKIP passes back the next starting point explicitly, but if it is the      /* SKIP passes back the next starting point explicitly, but if it is no
6929      same as the match we have just done, treat it as NOMATCH. */      greater than the match we have just done, treat it as NOMATCH. */
6930    
6931      case MATCH_SKIP:      case MATCH_SKIP:
6932      if (md->start_match_ptr != start_match)      if (md->start_match_ptr > start_match)
6933        {        {
6934        new_start_match = md->start_match_ptr;        new_start_match = md->start_match_ptr;
6935        break;        break;
# Line 6865  for(;;) Line 6937  for(;;)
6937      /* Fall through */      /* Fall through */
6938    
6939      /* NOMATCH and PRUNE advance by one character. THEN at this level acts      /* NOMATCH and PRUNE advance by one character. THEN at this level acts
6940      exactly like PRUNE. Unset the ignore SKIP-with-argument flag. */      exactly like PRUNE. Unset ignore SKIP-with-argument. */
6941    
6942      case MATCH_NOMATCH:      case MATCH_NOMATCH:
6943      case MATCH_PRUNE:      case MATCH_PRUNE:
6944      case MATCH_THEN:      case MATCH_THEN:
6945      md->ignore_skip_arg = FALSE;      md->ignore_skip_arg = 0;
6946      new_start_match = start_match + 1;      new_start_match = start_match + 1;
6947  #ifdef SUPPORT_UTF  #ifdef SUPPORT_UTF
6948      if (utf)      if (utf)
# Line 6971  if (rc == MATCH_MATCH || rc == MATCH_ACC Line 7043  if (rc == MATCH_MATCH || rc == MATCH_ACC
7043    /* Set the return code to the number of captured strings, or 0 if there were    /* Set the return code to the number of captured strings, or 0 if there were
7044    too many to fit into the vector. */    too many to fit into the vector. */
7045    
7046    rc = ((md->capture_last & OVFLBIT) != 0 &&    rc = ((md->capture_last & OVFLBIT) != 0 &&
7047           md->end_offset_top >= arg_offset_max)?           md->end_offset_top >= arg_offset_max)?
7048      0 : md->end_offset_top/2;      0 : md->end_offset_top/2;
7049    
# Line 7045  if (start_partial != NULL) Line 7117  if (start_partial != NULL)
7117      {      {
7118      offsets[0] = (int)(start_partial - (PCRE_PUCHAR)subject);      offsets[0] = (int)(start_partial - (PCRE_PUCHAR)subject);
7119      offsets[1] = (int)(end_subject - (PCRE_PUCHAR)subject);      offsets[1] = (int)(end_subject - (PCRE_PUCHAR)subject);
7120        if (offsetcount > 2)
7121          offsets[2] = (int)(match_partial - (PCRE_PUCHAR)subject);
7122      }      }
7123    rc = PCRE_ERROR_PARTIAL;    rc = PCRE_ERROR_PARTIAL;
7124    }    }

Legend:
Removed from v.1248  
changed lines
  Added in v.1274

  ViewVC Help
Powered by ViewVC 1.1.5