/[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 771 by ph10, Tue Nov 29 15:34:12 2011 UTC revision 778 by ph10, Thu Dec 1 17:38:47 2011 UTC
# Line 417  returns a negative (error) response, the Line 417  returns a negative (error) response, the
417  same response. */  same response. */
418    
419  /* These macros pack up tests that are used for partial matching, and which  /* These macros pack up tests that are used for partial matching, and which
420  appears several times in the code. We set the "hit end" flag if the pointer is  appear several times in the code. We set the "hit end" flag if the pointer is
421  at the end of the subject and also past the start of the subject (i.e.  at the end of the subject and also past the start of the subject (i.e.
422  something has been matched). For hard partial matching, we then return  something has been matched). For hard partial matching, we then return
423  immediately. The second one is used when we already know we are past the end of  immediately. The second one is used when we already know we are past the end of
# Line 3037  for (;;) Line 3037  for (;;)
3037        }        }
3038      break;      break;
3039    
3040      /* Match a single character, caselessly */      /* Match a single character, caselessly. If we are at the end of the
3041        subject, give up immediately. */
3042    
3043      case OP_CHARI:      case OP_CHARI:
3044        if (eptr >= md->end_subject)
3045          {
3046          SCHECK_PARTIAL();
3047          RRETURN(MATCH_NOMATCH);
3048          }
3049    
3050  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3051      if (utf8)      if (utf8)
3052        {        {
3053        length = 1;        length = 1;
3054        ecode++;        ecode++;
3055        GETCHARLEN(fc, ecode, length);        GETCHARLEN(fc, ecode, length);
3056    
       if (length > md->end_subject - eptr)  
         {  
         CHECK_PARTIAL();             /* Not SCHECK_PARTIAL() */  
         RRETURN(MATCH_NOMATCH);  
         }  
   
3057        /* If the pattern character's value is < 128, we have only one byte, and        /* If the pattern character's value is < 128, we have only one byte, and
3058        can use the fast lookup table. */        we know that its other case must also be one byte long, so we can use the
3059          fast lookup table. We know that there is at least one byte left in the
3060          subject. */
3061    
3062        if (fc < 128)        if (fc < 128)
3063          {          {
3064          if (md->lcc[*ecode++] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);          if (md->lcc[*ecode++] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);
3065          }          }
3066    
3067        /* Otherwise we must pick up the subject character */        /* Otherwise we must pick up the subject character. Note that we cannot
3068          use the value of "length" to check for sufficient bytes left, because the
3069          other case of the character may have more or fewer bytes.  */
3070    
3071        else        else
3072          {          {
# Line 3086  for (;;) Line 3091  for (;;)
3091    
3092      /* Non-UTF-8 mode */      /* Non-UTF-8 mode */
3093        {        {
       if (md->end_subject - eptr < 1)  
         {  
         SCHECK_PARTIAL();            /* This one can use SCHECK_PARTIAL() */  
         RRETURN(MATCH_NOMATCH);  
         }  
3094        if (md->lcc[ecode[1]] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);        if (md->lcc[ecode[1]] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH);
3095        ecode += 2;        ecode += 2;
3096        }        }

Legend:
Removed from v.771  
changed lines
  Added in v.778

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12