/[pcre]/code/branches/pcre16/pcre_dfa_exec.c
ViewVC logotype

Diff of /code/branches/pcre16/pcre_dfa_exec.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 781 by zherczeg, Sat Dec 3 07:58:30 2011 UTC revision 782 by zherczeg, Sat Dec 3 23:58:37 2011 UTC
# Line 480  if (*first_op == OP_REVERSE) Line 480  if (*first_op == OP_REVERSE)
480        {        {
481        if (current_subject <= start_subject) break;        if (current_subject <= start_subject) break;
482        current_subject--;        current_subject--;
483        while (current_subject > start_subject &&        INTERNALCHAR(current_subject > start_subject, *current_subject, current_subject--);
              (*current_subject & 0xc0) == 0x80)  
         current_subject--;  
484        }        }
485      }      }
486    else    else
# Line 3161  if (utf && (options & PCRE_NO_UTF8_CHECK Line 3159  if (utf && (options & PCRE_NO_UTF8_CHECK
3159      return (errorcode <= PCRE_UTF8_ERR5 && (options & PCRE_PARTIAL_HARD) != 0)?      return (errorcode <= PCRE_UTF8_ERR5 && (options & PCRE_PARTIAL_HARD) != 0)?
3160        PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;        PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;
3161      }      }
3162    #ifdef COMPILE_PCRE8
3163    if (start_offset > 0 && start_offset < length &&    if (start_offset > 0 && start_offset < length &&
3164          (((PCRE_PUCHAR)subject)[start_offset] & 0xc0) == 0x80)          (((PCRE_PUCHAR)subject)[start_offset] & 0xc0) == 0x80)
3165      return PCRE_ERROR_BADUTF8_OFFSET;      return PCRE_ERROR_BADUTF8_OFFSET;
3166    #else
3167    #ifdef COMPILE_PCRE16
3168      if (start_offset > 0 && start_offset < length &&
3169            (((PCRE_PUCHAR)subject)[start_offset] & 0xfc00) == 0xdc00)
3170        return PCRE_ERROR_BADUTF8_OFFSET;
3171    #endif /* COMPILE_PCRE16 */
3172    #endif /* COMPILE_PCRE8 */
3173    }    }
3174  #endif  #endif
3175    
# Line 3234  for (;;) Line 3240  for (;;)
3240      if (firstline)      if (firstline)
3241        {        {
3242        PCRE_PUCHAR t = current_subject;        PCRE_PUCHAR t = current_subject;
3243  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
3244        if (utf)        if (utf)
3245          {          {
3246          while (t < md->end_subject && !IS_NEWLINE(t))          while (t < md->end_subject && !IS_NEWLINE(t))
3247            {            {
3248            t++;            t++;
3249            while (t < end_subject && (*t & 0xc0) == 0x80) t++;            INTERNALCHAR(t < end_subject, *t, t++);
3250            }            }
3251          }          }
3252        else        else
# Line 3277  for (;;) Line 3283  for (;;)
3283          {          {
3284          if (current_subject > md->start_subject + start_offset)          if (current_subject > md->start_subject + start_offset)
3285            {            {
3286  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
3287            if (utf)            if (utf)
3288              {              {
3289              while (current_subject < end_subject &&              while (current_subject < end_subject &&
3290                     !WAS_NEWLINE(current_subject))                     !WAS_NEWLINE(current_subject))
3291                {                {
3292                current_subject++;                current_subject++;
3293                while(current_subject < end_subject &&                INTERNALCHAR(current_subject < end_subject, *current_subject,
3294                      (*current_subject & 0xc0) == 0x80)                  current_subject++);
                 current_subject++;  
3295                }                }
3296              }              }
3297            else            else
# Line 3316  for (;;) Line 3321  for (;;)
3321            if ((start_bits[c/8] & (1 << (c&7))) == 0)            if ((start_bits[c/8] & (1 << (c&7))) == 0)
3322              {              {
3323              current_subject++;              current_subject++;
3324  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF
3325              if (utf)              if (utf)
3326                while(current_subject < end_subject &&                INTERNALCHAR(current_subject < end_subject, *current_subject,
3327                      (*current_subject & 0xc0) == 0x80) current_subject++;                  current_subject++);
3328  #endif  #endif
3329              }              }
3330            else break;            else break;
# Line 3426  for (;;) Line 3431  for (;;)
3431    
3432    if (firstline && IS_NEWLINE(current_subject)) break;    if (firstline && IS_NEWLINE(current_subject)) break;
3433    current_subject++;    current_subject++;
3434    #ifdef SUPPORT_UTF
3435    if (utf)    if (utf)
3436      {      {
3437      while (current_subject < end_subject && (*current_subject & 0xc0) == 0x80)      INTERNALCHAR(current_subject < end_subject, *current_subject,
3438        current_subject++;        current_subject++);
3439      }      }
3440    #endif
3441    if (current_subject > end_subject) break;    if (current_subject > end_subject) break;
3442    
3443    /* If we have just passed a CR and we are now at a LF, and the pattern does    /* If we have just passed a CR and we are now at a LF, and the pattern does

Legend:
Removed from v.781  
changed lines
  Added in v.782

  ViewVC Help
Powered by ViewVC 1.1.5