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

Diff of /code/trunk/pcre_compile.c

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

revision 411 by ph10, Fri Apr 10 15:40:21 2009 UTC revision 412 by ph10, Sat Apr 11 10:34:37 2009 UTC
# Line 6226  if (erroroffset == NULL) Line 6226  if (erroroffset == NULL)
6226    
6227  *erroroffset = 0;  *erroroffset = 0;
6228    
 /* Can't support UTF8 unless PCRE has been compiled to include the code. */  
   
 #ifdef SUPPORT_UTF8  
 utf8 = (options & PCRE_UTF8) != 0;  
 if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 &&  
      (*erroroffset = _pcre_valid_utf8((uschar *)pattern, -1)) >= 0)  
   {  
   errorcode = ERR44;  
   goto PCRE_EARLY_ERROR_RETURN2;  
   }  
 #else  
 if ((options & PCRE_UTF8) != 0)  
   {  
   errorcode = ERR32;  
   goto PCRE_EARLY_ERROR_RETURN;  
   }  
 #endif  
   
 if ((options & ~PUBLIC_COMPILE_OPTIONS) != 0)  
   {  
   errorcode = ERR17;  
   goto PCRE_EARLY_ERROR_RETURN;  
   }  
   
6229  /* Set up pointers to the individual character tables */  /* Set up pointers to the individual character tables */
6230    
6231  if (tables == NULL) tables = _pcre_default_tables;  if (tables == NULL) tables = _pcre_default_tables;
# Line 6258  cd->fcc = tables + fcc_offset; Line 6234  cd->fcc = tables + fcc_offset;
6234  cd->cbits = tables + cbits_offset;  cd->cbits = tables + cbits_offset;
6235  cd->ctypes = tables + ctypes_offset;  cd->ctypes = tables + ctypes_offset;
6236    
6237    /* Check that all undefined public option bits are zero */
6238    
6239    if ((options & ~PUBLIC_COMPILE_OPTIONS) != 0)
6240      {
6241      errorcode = ERR17;
6242      goto PCRE_EARLY_ERROR_RETURN;
6243      }
6244    
6245  /* Check for global one-time settings at the start of the pattern, and remember  /* Check for global one-time settings at the start of the pattern, and remember
6246  the offset for later. */  the offset for later. */
6247    
# Line 6267  while (ptr[skipatstart] == CHAR_LEFT_PAR Line 6251  while (ptr[skipatstart] == CHAR_LEFT_PAR
6251    int newnl = 0;    int newnl = 0;
6252    int newbsr = 0;    int newbsr = 0;
6253    
6254      if (strncmp((char *)(ptr+skipatstart+2), STRING_UTF8_RIGHTPAR, 5) == 0)
6255        { skipatstart += 7; options |= PCRE_UTF8; continue; }
6256    
6257    if (strncmp((char *)(ptr+skipatstart+2), STRING_CR_RIGHTPAR, 3) == 0)    if (strncmp((char *)(ptr+skipatstart+2), STRING_CR_RIGHTPAR, 3) == 0)
6258      { skipatstart += 5; newnl = PCRE_NEWLINE_CR; }      { skipatstart += 5; newnl = PCRE_NEWLINE_CR; }
6259    else if (strncmp((char *)(ptr+skipatstart+2), STRING_LF_RIGHTPAR, 3)  == 0)    else if (strncmp((char *)(ptr+skipatstart+2), STRING_LF_RIGHTPAR, 3)  == 0)
# Line 6290  while (ptr[skipatstart] == CHAR_LEFT_PAR Line 6277  while (ptr[skipatstart] == CHAR_LEFT_PAR
6277    else break;    else break;
6278    }    }
6279    
6280    /* Can't support UTF8 unless PCRE has been compiled to include the code. */
6281    
6282    #ifdef SUPPORT_UTF8
6283    utf8 = (options & PCRE_UTF8) != 0;
6284    if (utf8 && (options & PCRE_NO_UTF8_CHECK) == 0 &&
6285         (*erroroffset = _pcre_valid_utf8((uschar *)pattern, -1)) >= 0)
6286      {
6287      errorcode = ERR44;
6288      goto PCRE_EARLY_ERROR_RETURN2;
6289      }
6290    #else
6291    if ((options & PCRE_UTF8) != 0)
6292      {
6293      errorcode = ERR32;
6294      goto PCRE_EARLY_ERROR_RETURN;
6295      }
6296    #endif
6297    
6298  /* Check validity of \R options. */  /* Check validity of \R options. */
6299    
6300  switch (options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE))  switch (options & (PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE))

Legend:
Removed from v.411  
changed lines
  Added in v.412

  ViewVC Help
Powered by ViewVC 1.1.5