| 48 |
|
|
| 49 |
#include "pcre_internal.h" |
#include "pcre_internal.h" |
| 50 |
|
|
| 51 |
|
/* Undefine some potentially clashing cpp symbols */ |
| 52 |
|
|
| 53 |
|
#undef min |
| 54 |
|
#undef max |
| 55 |
|
|
| 56 |
/* The chain of eptrblocks for tail recursions uses memory in stack workspace, |
/* The chain of eptrblocks for tail recursions uses memory in stack workspace, |
| 57 |
obtained at top level, the size of which is defined by EPTR_WORK_SIZE. */ |
obtained at top level, the size of which is defined by EPTR_WORK_SIZE. */ |
| 58 |
|
|
| 3712 |
< -1 => some kind of unexpected problem |
< -1 => some kind of unexpected problem |
| 3713 |
*/ |
*/ |
| 3714 |
|
|
| 3715 |
PCRE_DATA_SCOPE int |
PCRE_EXP_DEFN int |
| 3716 |
pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, |
pcre_exec(const pcre *argument_re, const pcre_extra *extra_data, |
| 3717 |
PCRE_SPTR subject, int length, int start_offset, int options, int *offsets, |
PCRE_SPTR subject, int length, int start_offset, int options, int *offsets, |
| 3718 |
int offsetcount) |
int offsetcount) |
| 3831 |
/* Handle different types of newline. The three bits give eight cases. If |
/* Handle different types of newline. The three bits give eight cases. If |
| 3832 |
nothing is set at run time, whatever was used at compile time applies. */ |
nothing is set at run time, whatever was used at compile time applies. */ |
| 3833 |
|
|
| 3834 |
switch ((((options & PCRE_NEWLINE_BITS) == 0)? re->options : options) & |
switch ((((options & PCRE_NEWLINE_BITS) == 0)? re->options : (pcre_uint32)options) & |
| 3835 |
PCRE_NEWLINE_BITS) |
PCRE_NEWLINE_BITS) |
| 3836 |
{ |
{ |
| 3837 |
case 0: newline = NEWLINE; break; /* Compile-time default */ |
case 0: newline = NEWLINE; break; /* Compile-time default */ |
| 4018 |
{ |
{ |
| 4019 |
while (start_match <= end_subject && !WAS_NEWLINE(start_match)) |
while (start_match <= end_subject && !WAS_NEWLINE(start_match)) |
| 4020 |
start_match++; |
start_match++; |
| 4021 |
|
|
| 4022 |
|
/* If we have just passed a CR and the newline option is ANY, and we are |
| 4023 |
|
now at a LF, advance the match position by one more character. */ |
| 4024 |
|
|
| 4025 |
|
if (start_match[-1] == '\r' && |
| 4026 |
|
md->nltype == NLTYPE_ANY && |
| 4027 |
|
start_match < end_subject && |
| 4028 |
|
*start_match == '\n') |
| 4029 |
|
start_match++; |
| 4030 |
} |
} |
| 4031 |
} |
} |
| 4032 |
|
|