| 240 |
int errorcode; |
int errorcode; |
| 241 |
int options = 0; |
int options = 0; |
| 242 |
|
|
| 243 |
if ((cflags & REG_ICASE) != 0) options |= PCRE_CASELESS; |
if ((cflags & REG_ICASE) != 0) options |= PCRE_CASELESS; |
| 244 |
if ((cflags & REG_NEWLINE) != 0) options |= PCRE_MULTILINE; |
if ((cflags & REG_NEWLINE) != 0) options |= PCRE_MULTILINE; |
| 245 |
if ((cflags & REG_DOTALL) != 0) options |= PCRE_DOTALL; |
if ((cflags & REG_DOTALL) != 0) options |= PCRE_DOTALL; |
| 246 |
if ((cflags & REG_NOSUB) != 0) options |= PCRE_NO_AUTO_CAPTURE; |
if ((cflags & REG_NOSUB) != 0) options |= PCRE_NO_AUTO_CAPTURE; |
| 247 |
if ((cflags & REG_UTF8) != 0) options |= PCRE_UTF8; |
if ((cflags & REG_UTF8) != 0) options |= PCRE_UTF8; |
| 248 |
|
if ((cflags & REG_UNGREEDY) != 0) options |= PCRE_UNGREEDY; |
| 249 |
|
|
| 250 |
preg->re_pcre = pcre_compile2(pattern, options, &errorcode, &errorptr, |
preg->re_pcre = pcre_compile2(pattern, options, &errorcode, &errorptr, |
| 251 |
&erroffset, NULL); |
&erroffset, NULL); |
| 300 |
|
|
| 301 |
((regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compile */ |
((regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compile */ |
| 302 |
|
|
| 303 |
/* When no string data is being returned, ensure that nmatch is zero. |
/* When no string data is being returned, or no vector has been passed in which |
| 304 |
Otherwise, ensure the vector for holding the return data is large enough. */ |
to put it, ensure that nmatch is zero. Otherwise, ensure the vector for holding |
| 305 |
|
the return data is large enough. */ |
| 306 |
|
|
| 307 |
if (nosub) nmatch = 0; |
if (nosub || pmatch == NULL) nmatch = 0; |
| 308 |
|
|
| 309 |
else if (nmatch > 0) |
else if (nmatch > 0) |
| 310 |
{ |
{ |