/[pcre]/code/trunk/pcre_dfa_exec.c
ViewVC logotype

Diff of /code/trunk/pcre_dfa_exec.c

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

revision 604 by ph10, Thu Jun 2 19:04:54 2011 UTC revision 606 by ph10, Mon Jun 6 17:46:22 2011 UTC
# Line 3123  back the character offset. */ Line 3123  back the character offset. */
3123  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
3124  if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)  if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
3125    {    {
3126    int errorcode;    int erroroffset;
3127    int tb = _pcre_valid_utf8((uschar *)subject, length, &errorcode);    int errorcode = _pcre_valid_utf8((uschar *)subject, length, &erroroffset);
3128    if (tb >= 0)    if (errorcode != 0)
3129      {      {
3130      if (offsetcount >= 2)      if (offsetcount >= 2)
3131        {        {
3132        offsets[0] = tb;        offsets[0] = erroroffset;
3133        offsets[1] = errorcode;        offsets[1] = errorcode;
3134        }        }
3135      return (errorcode <= PCRE_UTF8_ERR5 && (options & PCRE_PARTIAL_HARD) != 0)?      return (errorcode <= PCRE_UTF8_ERR5 && (options & PCRE_PARTIAL_HARD) != 0)?
3136        PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;        PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;
3137      }      }
3138    if (start_offset > 0 && start_offset < length)    if (start_offset > 0 && start_offset < length &&
3139      {          (((USPTR)subject)[start_offset] & 0xc0) == 0x80)
3140      tb = ((USPTR)subject)[start_offset] & 0xc0;      return PCRE_ERROR_BADUTF8_OFFSET;
     if (tb == 0x80) return PCRE_ERROR_BADUTF8_OFFSET;  
     }  
3141    }    }
3142  #endif  #endif
3143    

Legend:
Removed from v.604  
changed lines
  Added in v.606

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12