| 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) |
| 3840 |
case PCRE_NEWLINE_CR+ |
case PCRE_NEWLINE_CR+ |
| 3841 |
PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break; |
PCRE_NEWLINE_LF: newline = ('\r' << 8) | '\n'; break; |
| 3842 |
case PCRE_NEWLINE_ANY: newline = -1; break; |
case PCRE_NEWLINE_ANY: newline = -1; break; |
| 3843 |
|
case PCRE_NEWLINE_ANYCRLF: newline = -2; break; |
| 3844 |
default: return PCRE_ERROR_BADNEWLINE; |
default: return PCRE_ERROR_BADNEWLINE; |
| 3845 |
} |
} |
| 3846 |
|
|
| 3847 |
if (newline < 0) |
if (newline == -2) |
| 3848 |
|
{ |
| 3849 |
|
md->nltype = NLTYPE_ANYCRLF; |
| 3850 |
|
} |
| 3851 |
|
else if (newline < 0) |
| 3852 |
{ |
{ |
| 3853 |
md->nltype = NLTYPE_ANY; |
md->nltype = NLTYPE_ANY; |
| 3854 |
} |
} |
| 4024 |
while (start_match <= end_subject && !WAS_NEWLINE(start_match)) |
while (start_match <= end_subject && !WAS_NEWLINE(start_match)) |
| 4025 |
start_match++; |
start_match++; |
| 4026 |
|
|
| 4027 |
/* If we have just passed a CR and the newline option is ANY, and we are |
/* If we have just passed a CR and the newline option is ANY or ANYCRLF, |
| 4028 |
now at a LF, advance the match position by one more character. */ |
and we are now at a LF, advance the match position by one more character. |
| 4029 |
|
*/ |
| 4030 |
|
|
| 4031 |
if (start_match[-1] == '\r' && |
if (start_match[-1] == '\r' && |
| 4032 |
md->nltype == NLTYPE_ANY && |
(md->nltype == NLTYPE_ANY || md->nltype == NLTYPE_ANYCRLF) && |
| 4033 |
start_match < end_subject && |
start_match < end_subject && |
| 4034 |
*start_match == '\n') |
*start_match == '\n') |
| 4035 |
start_match++; |
start_match++; |
| 4148 |
|
|
| 4149 |
if (anchored || start_match > end_subject) break; |
if (anchored || start_match > end_subject) break; |
| 4150 |
|
|
| 4151 |
/* If we have just passed a CR and the newline option is CRLF or ANY, and we |
/* If we have just passed a CR and the newline option is CRLF or ANY or |
| 4152 |
are now at a LF, advance the match position by one more character. */ |
ANYCRLF, and we are now at a LF, advance the match position by one more |
| 4153 |
|
character. */ |
| 4154 |
|
|
| 4155 |
if (start_match[-1] == '\r' && |
if (start_match[-1] == '\r' && |
| 4156 |
(md->nltype == NLTYPE_ANY || md->nllen == 2) && |
(md->nltype == NLTYPE_ANY || |
| 4157 |
|
md->nltype == NLTYPE_ANYCRLF || |
| 4158 |
|
md->nllen == 2) && |
| 4159 |
start_match < end_subject && |
start_match < end_subject && |
| 4160 |
*start_match == '\n') |
*start_match == '\n') |
| 4161 |
start_match++; |
start_match++; |