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; |
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 |
|
|
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) |
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)) |