/[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 598 by ph10, Sat May 7 15:37:31 2011 UTC revision 600 by ph10, Mon May 9 08:54:11 2011 UTC
# Line 2017  for (;;) Line 2017  for (;;)
2017      switch(c)      switch(c)
2018        {        {
2019        default: MRRETURN(MATCH_NOMATCH);        default: MRRETURN(MATCH_NOMATCH);
2020    
2021        case 0x000d:        case 0x000d:
2022        if (eptr < md->end_subject && *eptr == 0x0a) eptr++;        if (eptr < md->end_subject && *eptr == 0x0a) eptr++;
2023        break;        break;
# Line 3791  for (;;) Line 3792  for (;;)
3792            switch(c)            switch(c)
3793              {              {
3794              default: MRRETURN(MATCH_NOMATCH);              default: MRRETURN(MATCH_NOMATCH);
3795    
3796              case 0x000d:              case 0x000d:
3797              if (eptr < md->end_subject && *eptr == 0x0a) eptr++;              if (eptr < md->end_subject && *eptr == 0x0a) eptr++;
3798              break;              break;
# Line 4067  for (;;) Line 4069  for (;;)
4069            switch(*eptr++)            switch(*eptr++)
4070              {              {
4071              default: MRRETURN(MATCH_NOMATCH);              default: MRRETURN(MATCH_NOMATCH);
4072    
4073              case 0x000d:              case 0x000d:
4074              if (eptr < md->end_subject && *eptr == 0x0a) eptr++;              if (eptr < md->end_subject && *eptr == 0x0a) eptr++;
4075              break;              break;
4076    
4077              case 0x000a:              case 0x000a:
4078              break;              break;
4079    
# Line 5258  for (;;) Line 5262  for (;;)
5262            RRETURN(PCRE_ERROR_INTERNAL);            RRETURN(PCRE_ERROR_INTERNAL);
5263            }            }
5264    
5265          /* eptr is now past the end of the maximum run */          /* eptr is now past the end of the maximum run. If possessive, we are
5266            done (no backing up). Otherwise, match at this position; anything other
5267            than no match is immediately returned. For nomatch, back up one
5268            character, unless we are matching \R and the last thing matched was
5269            \r\n, in which case, back up two bytes. */
5270    
5271          if (possessive) continue;          if (possessive) continue;
5272          for(;;)          for(;;)
# Line 5267  for (;;) Line 5275  for (;;)
5275            if (rrc != MATCH_NOMATCH) RRETURN(rrc);            if (rrc != MATCH_NOMATCH) RRETURN(rrc);
5276            if (eptr-- == pp) break;        /* Stop if tried at original pos */            if (eptr-- == pp) break;        /* Stop if tried at original pos */
5277            BACKCHAR(eptr);            BACKCHAR(eptr);
5278              if (ctype == OP_ANYNL && eptr > pp  && *eptr == '\n' &&
5279                  eptr[-1] == '\r') eptr--;
5280            }            }
5281          }          }
5282        else        else
# Line 5465  for (;;) Line 5475  for (;;)
5475            RRETURN(PCRE_ERROR_INTERNAL);            RRETURN(PCRE_ERROR_INTERNAL);
5476            }            }
5477    
5478          /* eptr is now past the end of the maximum run */          /* eptr is now past the end of the maximum run. If possessive, we are
5479            done (no backing up). Otherwise, match at this position; anything other
5480            than no match is immediately returned. For nomatch, back up one
5481            character (byte), unless we are matching \R and the last thing matched
5482            was \r\n, in which case, back up two bytes. */
5483    
5484          if (possessive) continue;          if (possessive) continue;
5485          while (eptr >= pp)          while (eptr >= pp)
5486            {            {
5487            RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM47);            RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM47);
           eptr--;  
5488            if (rrc != MATCH_NOMATCH) RRETURN(rrc);            if (rrc != MATCH_NOMATCH) RRETURN(rrc);
5489              eptr--;
5490              if (ctype == OP_ANYNL && eptr > pp  && *eptr == '\n' &&
5491                  eptr[-1] == '\r') eptr--;
5492            }            }
5493          }          }
5494    

Legend:
Removed from v.598  
changed lines
  Added in v.600

  ViewVC Help
Powered by ViewVC 1.1.5