/[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 566 by ph10, Sun Oct 31 14:15:04 2010 UTC revision 567 by ph10, Sat Nov 6 17:10:00 2010 UTC
# Line 5634  if ((options & ~PUBLIC_EXEC_OPTIONS) != Line 5634  if ((options & ~PUBLIC_EXEC_OPTIONS) !=
5634  if (re == NULL || subject == NULL ||  if (re == NULL || subject == NULL ||
5635     (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;     (offsets == NULL && offsetcount > 0)) return PCRE_ERROR_NULL;
5636  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;  if (offsetcount < 0) return PCRE_ERROR_BADCOUNT;
5637    if (start_offset < 0 || start_offset > length) return PCRE_ERROR_BADOFFSET;
5638    
5639  /* This information is for finding all the numbers associated with a given  /* This information is for finding all the numbers associated with a given
5640  name, for condition testing. */  name, for condition testing. */
# Line 5804  if (utf8 && (options & PCRE_NO_UTF8_CHEC Line 5805  if (utf8 && (options & PCRE_NO_UTF8_CHEC
5805      return PCRE_ERROR_BADUTF8;      return PCRE_ERROR_BADUTF8;
5806    if (start_offset > 0 && start_offset < length)    if (start_offset > 0 && start_offset < length)
5807      {      {
5808      int tb = ((USPTR)subject)[start_offset];      int tb = ((USPTR)subject)[start_offset] & 0xc0;
5809      if (tb > 127)      if (tb == 0x80) return PCRE_ERROR_BADUTF8_OFFSET;
       {  
       tb &= 0xc0;  
       if (tb != 0 && tb != 0xc0) return PCRE_ERROR_BADUTF8_OFFSET;  
       }  
5810      }      }
5811    }    }
5812  #endif  #endif

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

  ViewVC Help
Powered by ViewVC 1.1.5