| 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 |
|
|
| 304 |
int Xprop_category; |
int Xprop_category; |
| 305 |
int Xprop_chartype; |
int Xprop_chartype; |
| 306 |
int Xprop_script; |
int Xprop_script; |
| 307 |
int Xoclength; |
int Xoclength; |
| 308 |
uschar Xocchars[8]; |
uschar Xocchars[8]; |
| 309 |
#endif |
#endif |
| 310 |
|
|
| 311 |
int Xctype; |
int Xctype; |
| 2067 |
for (i = 1; i <= min; i++) |
for (i = 1; i <= min; i++) |
| 2068 |
{ |
{ |
| 2069 |
if (memcmp(eptr, charptr, length) == 0) eptr += length; |
if (memcmp(eptr, charptr, length) == 0) eptr += length; |
| 2070 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2071 |
/* Need braces because of following else */ |
/* Need braces because of following else */ |
| 2072 |
else if (oclength == 0) { RRETURN(MATCH_NOMATCH); } |
else if (oclength == 0) { RRETURN(MATCH_NOMATCH); } |
| 2073 |
else |
else |
| 2077 |
} |
} |
| 2078 |
#else /* without SUPPORT_UCP */ |
#else /* without SUPPORT_UCP */ |
| 2079 |
else { RRETURN(MATCH_NOMATCH); } |
else { RRETURN(MATCH_NOMATCH); } |
| 2080 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
| 2081 |
} |
} |
| 2082 |
|
|
| 2083 |
if (min == max) continue; |
if (min == max) continue; |
| 2090 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2091 |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (fi >= max || eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
| 2092 |
if (memcmp(eptr, charptr, length) == 0) eptr += length; |
if (memcmp(eptr, charptr, length) == 0) eptr += length; |
| 2093 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2094 |
/* Need braces because of following else */ |
/* Need braces because of following else */ |
| 2095 |
else if (oclength == 0) { RRETURN(MATCH_NOMATCH); } |
else if (oclength == 0) { RRETURN(MATCH_NOMATCH); } |
| 2096 |
else |
else |
| 2112 |
{ |
{ |
| 2113 |
if (eptr > md->end_subject - length) break; |
if (eptr > md->end_subject - length) break; |
| 2114 |
if (memcmp(eptr, charptr, length) == 0) eptr += length; |
if (memcmp(eptr, charptr, length) == 0) eptr += length; |
| 2115 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2116 |
else if (oclength == 0) break; |
else if (oclength == 0) break; |
| 2117 |
else |
else |
| 2118 |
{ |
{ |
| 2121 |
} |
} |
| 2122 |
#else /* without SUPPORT_UCP */ |
#else /* without SUPPORT_UCP */ |
| 2123 |
else break; |
else break; |
| 2124 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
| 2125 |
} |
} |
| 2126 |
|
|
| 2127 |
if (possessive) continue; |
if (possessive) continue; |
| 2128 |
while (eptr >= pp) |
for(;;) |
| 2129 |
{ |
{ |
| 2130 |
RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); |
RMATCH(rrc, eptr, ecode, offset_top, md, ims, eptrb, 0); |
| 2131 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2132 |
|
if (eptr == pp) RRETURN(MATCH_NOMATCH); |
| 2133 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2134 |
eptr--; |
eptr--; |
| 2135 |
BACKCHAR(eptr); |
BACKCHAR(eptr); |
| 2136 |
#else /* without SUPPORT_UCP */ |
#else /* without SUPPORT_UCP */ |
| 2137 |
eptr -= length; |
eptr -= length; |
| 2138 |
#endif /* SUPPORT_UCP */ |
#endif /* SUPPORT_UCP */ |
| 2139 |
} |
} |
|
RRETURN(MATCH_NOMATCH); |
|
| 2140 |
} |
} |
| 2141 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2142 |
} |
} |
| 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 |
|
|