/[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 597 by ph10, Mon May 2 17:08:52 2011 UTC revision 598 by ph10, Sat May 7 15:37:31 2011 UTC
# Line 6  Line 6 
6  and semantics are as close as possible to those of the Perl 5 language.  and semantics are as close as possible to those of the Perl 5 language.
7    
8                         Written by Philip Hazel                         Written by Philip Hazel
9             Copyright (c) 1997-2010 University of Cambridge             Copyright (c) 1997-2011 University of Cambridge
10    
11  -----------------------------------------------------------------------------  -----------------------------------------------------------------------------
12  Redistribution and use in source and binary forms, with or without  Redistribution and use in source and binary forms, with or without
# Line 5812  defined (though never set). So there's n Line 5812  defined (though never set). So there's n
5812  if (md->partial && (re->flags & PCRE_NOPARTIAL) != 0)  if (md->partial && (re->flags & PCRE_NOPARTIAL) != 0)
5813    return PCRE_ERROR_BADPARTIAL;    return PCRE_ERROR_BADPARTIAL;
5814    
5815  /* Check a UTF-8 string if required. Unfortunately there's no way of passing  /* Check a UTF-8 string if required. Pass back the character offset and error
5816  back the character offset. */  code if a results vector is available. */
5817    
5818  #ifdef SUPPORT_UTF8  #ifdef SUPPORT_UTF8
5819  if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)  if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0)
5820    {    {
5821    int tb;    int errorcode;
5822    if ((tb = _pcre_valid_utf8((USPTR)subject, length)) >= 0)    int tb = _pcre_valid_utf8((USPTR)subject, length, &errorcode);
5823      return (tb == length && md->partial > 1)?    if (tb >= 0)
5824        {
5825        if (offsetcount >= 2)
5826          {
5827          offsets[0] = tb;
5828          offsets[1] = errorcode;
5829          }
5830        return (errorcode <= PCRE_UTF8_ERR5 && md->partial > 1)?
5831        PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;        PCRE_ERROR_SHORTUTF8 : PCRE_ERROR_BADUTF8;
5832        }
5833    if (start_offset > 0 && start_offset < length)    if (start_offset > 0 && start_offset < length)
5834      {      {
5835      tb = ((USPTR)subject)[start_offset] & 0xc0;      tb = ((USPTR)subject)[start_offset] & 0xc0;

Legend:
Removed from v.597  
changed lines
  Added in v.598

  ViewVC Help
Powered by ViewVC 1.1.5