/[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 567 by ph10, Sat Nov 6 17:10:00 2010 UTC revision 579 by ph10, Wed Nov 24 17:39:25 2010 UTC
# Line 1705  for (;;) Line 1705  for (;;)
1705        if (eptr < md->end_subject)        if (eptr < md->end_subject)
1706          { if (!IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); }          { if (!IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); }
1707        else        else
1708          {          {
1709          if (md->noteol) MRRETURN(MATCH_NOMATCH);          if (md->noteol) MRRETURN(MATCH_NOMATCH);
1710          SCHECK_PARTIAL();          SCHECK_PARTIAL();
1711          }          }
1712        ecode++;        ecode++;
# Line 1717  for (;;) Line 1717  for (;;)
1717        if (md->noteol) MRRETURN(MATCH_NOMATCH);        if (md->noteol) MRRETURN(MATCH_NOMATCH);
1718        if (!md->endonly) goto ASSERT_NL_OR_EOS;        if (!md->endonly) goto ASSERT_NL_OR_EOS;
1719        }        }
1720    
1721      /* ... else fall through for endonly */      /* ... else fall through for endonly */
1722    
1723      /* End of subject assertion (\z) */      /* End of subject assertion (\z) */
# Line 1735  for (;;) Line 1735  for (;;)
1735      if (eptr < md->end_subject &&      if (eptr < md->end_subject &&
1736          (!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen))          (!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen))
1737        MRRETURN(MATCH_NOMATCH);        MRRETURN(MATCH_NOMATCH);
1738    
1739      /* Either at end of string or \n before end. */      /* Either at end of string or \n before end. */
1740    
1741      SCHECK_PARTIAL();      SCHECK_PARTIAL();
1742      ecode++;      ecode++;
1743      break;      break;
# Line 5801  back the character offset. */ Line 5801  back the character offset. */
5801  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
5802  if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)  if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
5803    {    {
5804    if (_pcre_valid_utf8((USPTR)subject, length) >= 0)    int tb;
5805      return PCRE_ERROR_BADUTF8;    if ((tb = _pcre_valid_utf8((USPTR)subject, length)) >= 0)
5806        return (tb == length && md->partial > 1)?
5807          PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;
5808    if (start_offset > 0 && start_offset < length)    if (start_offset > 0 && start_offset < length)
5809      {      {
5810      int tb = ((USPTR)subject)[start_offset] & 0xc0;      tb = ((USPTR)subject)[start_offset] & 0xc0;
5811      if (tb == 0x80) return PCRE_ERROR_BADUTF8_OFFSET;      if (tb == 0x80) return PCRE_ERROR_BADUTF8_OFFSET;
5812      }      }
5813    }    }
# Line 5934  for(;;) Line 5936  for(;;)
5936    /* There are some optimizations that avoid running the match if a known    /* There are some optimizations that avoid running the match if a known
5937    starting point is not found, or if a known later character is not present.    starting point is not found, or if a known later character is not present.
5938    However, there is an option that disables these, for testing and for ensuring    However, there is an option that disables these, for testing and for ensuring
5939    that all callouts do actually occur. */    that all callouts do actually occur. The option can be set in the regex by
5940      (*NO_START_OPT) or passed in match-time options. */
5941    
5942    if ((options & PCRE_NO_START_OPTIMIZE) == 0)    if (((options | re->options) & PCRE_NO_START_OPTIMIZE) == 0)
5943      {      {
5944      /* Advance to a unique first byte if there is one. */      /* Advance to a unique first byte if there is one. */
5945    

Legend:
Removed from v.567  
changed lines
  Added in v.579

  ViewVC Help
Powered by ViewVC 1.1.5