/[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 1305 by ph10, Mon Apr 1 14:50:45 2013 UTC revision 1309 by ph10, Fri Apr 5 15:35:59 2013 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-2012 University of Cambridge             Copyright (c) 1997-2013 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 508  static const char error_texts[] = Line 508  static const char error_texts[] =
508    "name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)\0"    "name is too long in (*MARK), (*PRUNE), (*SKIP), or (*THEN)\0"
509    "character value in \\u.... sequence is too large\0"    "character value in \\u.... sequence is too large\0"
510    "invalid UTF-32 string\0"    "invalid UTF-32 string\0"
511      "setting UTF is disabled by the application\0"
512    ;    ;
513    
514  /* Table to identify digits and hex digits. This is used when compiling  /* Table to identify digits and hex digits. This is used when compiling
# Line 7771  int newline; Line 7772  int newline;
7772  int errorcode = 0;  int errorcode = 0;
7773  int skipatstart = 0;  int skipatstart = 0;
7774  BOOL utf;  BOOL utf;
7775    BOOL never_utf = FALSE;
7776  size_t size;  size_t size;
7777  pcre_uchar *code;  pcre_uchar *code;
7778  const pcre_uchar *codestart;  const pcre_uchar *codestart;
# Line 7829  if ((options & ~PUBLIC_COMPILE_OPTIONS) Line 7831  if ((options & ~PUBLIC_COMPILE_OPTIONS)
7831    errorcode = ERR17;    errorcode = ERR17;
7832    goto PCRE_EARLY_ERROR_RETURN;    goto PCRE_EARLY_ERROR_RETURN;
7833    }    }
7834    
7835    /* If PCRE_NEVER_UTF is set, remember it. As this option steals a bit that is
7836    also used for execution options, flatten it just in case. */
7837    
7838    if ((options & PCRE_NEVER_UTF) != 0)
7839      {
7840      never_utf = TRUE;
7841      options &= ~PCRE_NEVER_UTF;
7842      }
7843    
7844  /* 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
7845  the offset for later. */  the offset for later. */
# Line 7885  PCRE_UTF8 == PCRE_UTF16 == PCRE_UTF32. * Line 7896  PCRE_UTF8 == PCRE_UTF16 == PCRE_UTF32. *
7896      options = (options & ~(PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) | newbsr;      options = (options & ~(PCRE_BSR_ANYCRLF|PCRE_BSR_UNICODE)) | newbsr;
7897    else break;    else break;
7898    }    }
7899    
7900  /* PCRE_UTF(16|32) have the same value as PCRE_UTF8. */  /* PCRE_UTF(16|32) have the same value as PCRE_UTF8. */
7901  utf = (options & PCRE_UTF8) != 0;  utf = (options & PCRE_UTF8) != 0;
7902    if (utf && never_utf)
7903      {
7904      errorcode = ERR78;
7905      goto PCRE_EARLY_ERROR_RETURN2;
7906      }
7907    
7908  /* Can't support UTF unless PCRE has been compiled to include the code. The  /* Can't support UTF unless PCRE has been compiled to include the code. The
7909  return of an error code from PRIV(valid_utf)() is a new feature, introduced in  return of an error code from PRIV(valid_utf)() is a new feature, introduced in

Legend:
Removed from v.1305  
changed lines
  Added in v.1309

  ViewVC Help
Powered by ViewVC 1.1.5