418 |
if (md->partial && eptr > mstart)\ |
if (md->partial && eptr > mstart)\ |
419 |
{\ |
{\ |
420 |
md->hitend = TRUE;\ |
md->hitend = TRUE;\ |
|
md->hitend = TRUE;\ |
|
421 |
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);\ |
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);\ |
422 |
} |
} |
423 |
|
|
663 |
{ |
{ |
664 |
minimize = possessive = FALSE; |
minimize = possessive = FALSE; |
665 |
op = *ecode; |
op = *ecode; |
666 |
|
|
|
/* For partial matching, remember if we ever hit the end of the subject after |
|
|
matching at least one subject character. This code is now wrapped in a macro |
|
|
because it appears several times below. */ |
|
|
|
|
|
CHECK_PARTIAL(); |
|
|
|
|
667 |
switch(op) |
switch(op) |
668 |
{ |
{ |
669 |
case OP_FAIL: |
case OP_FAIL: |
1480 |
GETCHAR(c, lastptr); |
GETCHAR(c, lastptr); |
1481 |
prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; |
prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; |
1482 |
} |
} |
1483 |
if (eptr >= md->end_subject) cur_is_word = FALSE; else |
if (eptr >= md->end_subject) |
1484 |
|
{ |
1485 |
|
SCHECK_PARTIAL(); |
1486 |
|
cur_is_word = FALSE; |
1487 |
|
} |
1488 |
|
else |
1489 |
{ |
{ |
1490 |
GETCHAR(c, eptr); |
GETCHAR(c, eptr); |
1491 |
cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; |
cur_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; |
1494 |
else |
else |
1495 |
#endif |
#endif |
1496 |
|
|
1497 |
/* More streamlined when not in UTF-8 mode */ |
/* Not in UTF-8 mode */ |
1498 |
|
|
1499 |
{ |
{ |
1500 |
prev_is_word = (eptr != md->start_subject) && |
prev_is_word = (eptr != md->start_subject) && |
1501 |
((md->ctypes[eptr[-1]] & ctype_word) != 0); |
((md->ctypes[eptr[-1]] & ctype_word) != 0); |
1502 |
cur_is_word = (eptr < md->end_subject) && |
if (eptr >= md->end_subject) |
1503 |
((md->ctypes[*eptr] & ctype_word) != 0); |
{ |
1504 |
|
SCHECK_PARTIAL(); |
1505 |
|
cur_is_word = FALSE; |
1506 |
|
} |
1507 |
|
else cur_is_word = ((md->ctypes[*eptr] & ctype_word) != 0); |
1508 |
} |
} |
1509 |
|
|
1510 |
/* Now see if the situation is what we want */ |
/* Now see if the situation is what we want */ |
1522 |
/* Fall through */ |
/* Fall through */ |
1523 |
|
|
1524 |
case OP_ALLANY: |
case OP_ALLANY: |
1525 |
if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr++ >= md->end_subject) |
1526 |
|
{ |
1527 |
|
SCHECK_PARTIAL(); |
1528 |
|
RRETURN(MATCH_NOMATCH); |
1529 |
|
} |
1530 |
if (utf8) while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
if (utf8) while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
1531 |
ecode++; |
ecode++; |
1532 |
break; |
break; |
1535 |
any byte, even newline, independent of the setting of PCRE_DOTALL. */ |
any byte, even newline, independent of the setting of PCRE_DOTALL. */ |
1536 |
|
|
1537 |
case OP_ANYBYTE: |
case OP_ANYBYTE: |
1538 |
if (eptr++ >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr++ >= md->end_subject) |
1539 |
|
{ |
1540 |
|
SCHECK_PARTIAL(); |
1541 |
|
RRETURN(MATCH_NOMATCH); |
1542 |
|
} |
1543 |
ecode++; |
ecode++; |
1544 |
break; |
break; |
1545 |
|
|
1546 |
case OP_NOT_DIGIT: |
case OP_NOT_DIGIT: |
1547 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1548 |
|
{ |
1549 |
|
SCHECK_PARTIAL(); |
1550 |
|
RRETURN(MATCH_NOMATCH); |
1551 |
|
} |
1552 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1553 |
if ( |
if ( |
1554 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
1561 |
break; |
break; |
1562 |
|
|
1563 |
case OP_DIGIT: |
case OP_DIGIT: |
1564 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1565 |
|
{ |
1566 |
|
SCHECK_PARTIAL(); |
1567 |
|
RRETURN(MATCH_NOMATCH); |
1568 |
|
} |
1569 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1570 |
if ( |
if ( |
1571 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
1578 |
break; |
break; |
1579 |
|
|
1580 |
case OP_NOT_WHITESPACE: |
case OP_NOT_WHITESPACE: |
1581 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1582 |
|
{ |
1583 |
|
SCHECK_PARTIAL(); |
1584 |
|
RRETURN(MATCH_NOMATCH); |
1585 |
|
} |
1586 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1587 |
if ( |
if ( |
1588 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
1595 |
break; |
break; |
1596 |
|
|
1597 |
case OP_WHITESPACE: |
case OP_WHITESPACE: |
1598 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1599 |
|
{ |
1600 |
|
SCHECK_PARTIAL(); |
1601 |
|
RRETURN(MATCH_NOMATCH); |
1602 |
|
} |
1603 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1604 |
if ( |
if ( |
1605 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
1612 |
break; |
break; |
1613 |
|
|
1614 |
case OP_NOT_WORDCHAR: |
case OP_NOT_WORDCHAR: |
1615 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1616 |
|
{ |
1617 |
|
SCHECK_PARTIAL(); |
1618 |
|
RRETURN(MATCH_NOMATCH); |
1619 |
|
} |
1620 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1621 |
if ( |
if ( |
1622 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
1629 |
break; |
break; |
1630 |
|
|
1631 |
case OP_WORDCHAR: |
case OP_WORDCHAR: |
1632 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1633 |
|
{ |
1634 |
|
SCHECK_PARTIAL(); |
1635 |
|
RRETURN(MATCH_NOMATCH); |
1636 |
|
} |
1637 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1638 |
if ( |
if ( |
1639 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
1646 |
break; |
break; |
1647 |
|
|
1648 |
case OP_ANYNL: |
case OP_ANYNL: |
1649 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1650 |
|
{ |
1651 |
|
SCHECK_PARTIAL(); |
1652 |
|
RRETURN(MATCH_NOMATCH); |
1653 |
|
} |
1654 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1655 |
switch(c) |
switch(c) |
1656 |
{ |
{ |
1674 |
break; |
break; |
1675 |
|
|
1676 |
case OP_NOT_HSPACE: |
case OP_NOT_HSPACE: |
1677 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1678 |
|
{ |
1679 |
|
SCHECK_PARTIAL(); |
1680 |
|
RRETURN(MATCH_NOMATCH); |
1681 |
|
} |
1682 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1683 |
switch(c) |
switch(c) |
1684 |
{ |
{ |
1708 |
break; |
break; |
1709 |
|
|
1710 |
case OP_HSPACE: |
case OP_HSPACE: |
1711 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1712 |
|
{ |
1713 |
|
SCHECK_PARTIAL(); |
1714 |
|
RRETURN(MATCH_NOMATCH); |
1715 |
|
} |
1716 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1717 |
switch(c) |
switch(c) |
1718 |
{ |
{ |
1742 |
break; |
break; |
1743 |
|
|
1744 |
case OP_NOT_VSPACE: |
case OP_NOT_VSPACE: |
1745 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1746 |
|
{ |
1747 |
|
SCHECK_PARTIAL(); |
1748 |
|
RRETURN(MATCH_NOMATCH); |
1749 |
|
} |
1750 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1751 |
switch(c) |
switch(c) |
1752 |
{ |
{ |
1764 |
break; |
break; |
1765 |
|
|
1766 |
case OP_VSPACE: |
case OP_VSPACE: |
1767 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1768 |
|
{ |
1769 |
|
SCHECK_PARTIAL(); |
1770 |
|
RRETURN(MATCH_NOMATCH); |
1771 |
|
} |
1772 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1773 |
switch(c) |
switch(c) |
1774 |
{ |
{ |
1791 |
|
|
1792 |
case OP_PROP: |
case OP_PROP: |
1793 |
case OP_NOTPROP: |
case OP_NOTPROP: |
1794 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1795 |
|
{ |
1796 |
|
SCHECK_PARTIAL(); |
1797 |
|
RRETURN(MATCH_NOMATCH); |
1798 |
|
} |
1799 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1800 |
{ |
{ |
1801 |
const ucd_record *prop = GET_UCD(c); |
const ucd_record *prop = GET_UCD(c); |
1840 |
is in the binary; otherwise a compile-time error occurs. */ |
is in the binary; otherwise a compile-time error occurs. */ |
1841 |
|
|
1842 |
case OP_EXTUNI: |
case OP_EXTUNI: |
1843 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
1844 |
|
{ |
1845 |
|
SCHECK_PARTIAL(); |
1846 |
|
RRETURN(MATCH_NOMATCH); |
1847 |
|
} |
1848 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
1849 |
{ |
{ |
1850 |
int category = UCD_CATEGORY(c); |
int category = UCD_CATEGORY(c); |
1924 |
break; |
break; |
1925 |
|
|
1926 |
default: /* No repeat follows */ |
default: /* No repeat follows */ |
1927 |
if (!match_ref(offset, eptr, length, md, ims)) RRETURN(MATCH_NOMATCH); |
if (!match_ref(offset, eptr, length, md, ims)) |
1928 |
|
{ |
1929 |
|
CHECK_PARTIAL(); |
1930 |
|
RRETURN(MATCH_NOMATCH); |
1931 |
|
} |
1932 |
eptr += length; |
eptr += length; |
1933 |
continue; /* With the main loop */ |
continue; /* With the main loop */ |
1934 |
} |
} |
1935 |
|
|
1936 |
/* If the length of the reference is zero, just continue with the |
/* If the length of the reference is zero, just continue with the |
1937 |
main loop. */ |
main loop. */ |
1938 |
|
|
1939 |
if (length == 0) continue; |
if (length == 0) continue; |
1940 |
|
|
1941 |
/* First, ensure the minimum number of matches are present. We get back |
/* First, ensure the minimum number of matches are present. We get back |
1965 |
{ |
{ |
1966 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM14); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM14); |
1967 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
1968 |
if (fi >= max || !match_ref(offset, eptr, length, md, ims)) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
1969 |
|
if (!match_ref(offset, eptr, length, md, ims)) |
1970 |
{ |
{ |
1971 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
1972 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
1986 |
if (!match_ref(offset, eptr, length, md, ims)) break; |
if (!match_ref(offset, eptr, length, md, ims)) break; |
1987 |
eptr += length; |
eptr += length; |
1988 |
} |
} |
|
CHECK_PARTIAL(); |
|
1989 |
while (eptr >= pp) |
while (eptr >= pp) |
1990 |
{ |
{ |
1991 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM15); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM15); |
1997 |
} |
} |
1998 |
/* Control never gets here */ |
/* Control never gets here */ |
1999 |
|
|
|
|
|
|
|
|
2000 |
/* Match a bit-mapped character class, possibly repeatedly. This op code is |
/* Match a bit-mapped character class, possibly repeatedly. This op code is |
2001 |
used when all the characters in the class have values in the range 0-255, |
used when all the characters in the class have values in the range 0-255, |
2002 |
and either the matching is caseful, or the characters are in the range |
and either the matching is caseful, or the characters are in the range |
2053 |
{ |
{ |
2054 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2055 |
{ |
{ |
2056 |
CHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2057 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
2058 |
} |
} |
2059 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
2075 |
{ |
{ |
2076 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2077 |
{ |
{ |
2078 |
CHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2079 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
2080 |
} |
} |
2081 |
c = *eptr++; |
c = *eptr++; |
2101 |
{ |
{ |
2102 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM16); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM16); |
2103 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2104 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2105 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2106 |
{ |
{ |
2107 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2126 |
{ |
{ |
2127 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM17); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM17); |
2128 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2129 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2130 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2131 |
{ |
{ |
2132 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2164 |
} |
} |
2165 |
eptr += len; |
eptr += len; |
2166 |
} |
} |
|
CHECK_PARTIAL(); |
|
2167 |
for (;;) |
for (;;) |
2168 |
{ |
{ |
2169 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM18); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM18); |
2183 |
if ((data[c/8] & (1 << (c&7))) == 0) break; |
if ((data[c/8] & (1 << (c&7))) == 0) break; |
2184 |
eptr++; |
eptr++; |
2185 |
} |
} |
|
CHECK_PARTIAL(); |
|
2186 |
while (eptr >= pp) |
while (eptr >= pp) |
2187 |
{ |
{ |
2188 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM19); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM19); |
2263 |
{ |
{ |
2264 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM20); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM20); |
2265 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2266 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2267 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2268 |
{ |
{ |
2269 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2288 |
if (!_pcre_xclass(c, data)) break; |
if (!_pcre_xclass(c, data)) break; |
2289 |
eptr += len; |
eptr += len; |
2290 |
} |
} |
|
CHECK_PARTIAL(); |
|
2291 |
for(;;) |
for(;;) |
2292 |
{ |
{ |
2293 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM21); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM21); |
2311 |
length = 1; |
length = 1; |
2312 |
ecode++; |
ecode++; |
2313 |
GETCHARLEN(fc, ecode, length); |
GETCHARLEN(fc, ecode, length); |
2314 |
if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); |
if (length > md->end_subject - eptr) |
2315 |
|
{ |
2316 |
|
CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ |
2317 |
|
RRETURN(MATCH_NOMATCH); |
2318 |
|
} |
2319 |
while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH); |
while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH); |
2320 |
} |
} |
2321 |
else |
else |
2323 |
|
|
2324 |
/* Non-UTF-8 mode */ |
/* Non-UTF-8 mode */ |
2325 |
{ |
{ |
2326 |
if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH); |
if (md->end_subject - eptr < 1) |
2327 |
|
{ |
2328 |
|
SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */ |
2329 |
|
RRETURN(MATCH_NOMATCH); |
2330 |
|
} |
2331 |
if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH); |
if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH); |
2332 |
ecode += 2; |
ecode += 2; |
2333 |
} |
} |
2343 |
ecode++; |
ecode++; |
2344 |
GETCHARLEN(fc, ecode, length); |
GETCHARLEN(fc, ecode, length); |
2345 |
|
|
2346 |
if (length > md->end_subject - eptr) RRETURN(MATCH_NOMATCH); |
if (length > md->end_subject - eptr) |
2347 |
|
{ |
2348 |
|
CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ |
2349 |
|
RRETURN(MATCH_NOMATCH); |
2350 |
|
} |
2351 |
|
|
2352 |
/* If the pattern character's value is < 128, we have only one byte, and |
/* If the pattern character's value is < 128, we have only one byte, and |
2353 |
can use the fast lookup table. */ |
can use the fast lookup table. */ |
2382 |
|
|
2383 |
/* Non-UTF-8 mode */ |
/* Non-UTF-8 mode */ |
2384 |
{ |
{ |
2385 |
if (md->end_subject - eptr < 1) RRETURN(MATCH_NOMATCH); |
if (md->end_subject - eptr < 1) |
2386 |
|
{ |
2387 |
|
SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */ |
2388 |
|
RRETURN(MATCH_NOMATCH); |
2389 |
|
} |
2390 |
if (md->lcc[ecode[1]] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); |
if (md->lcc[ecode[1]] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); |
2391 |
ecode += 2; |
ecode += 2; |
2392 |
} |
} |
2440 |
case OP_MINQUERY: |
case OP_MINQUERY: |
2441 |
c = *ecode++ - OP_STAR; |
c = *ecode++ - OP_STAR; |
2442 |
minimize = (c & 1) != 0; |
minimize = (c & 1) != 0; |
2443 |
|
|
2444 |
min = rep_min[c]; /* Pick up values from tables; */ |
min = rep_min[c]; /* Pick up values from tables; */ |
2445 |
max = rep_max[c]; /* zero for max => infinity */ |
max = rep_max[c]; /* zero for max => infinity */ |
2446 |
if (max == 0) max = INT_MAX; |
if (max == 0) max = INT_MAX; |
2493 |
{ |
{ |
2494 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM22); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM22); |
2495 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2496 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2497 |
if (eptr <= md->end_subject - length && |
if (eptr <= md->end_subject - length && |
2498 |
memcmp(eptr, charptr, length) == 0) eptr += length; |
memcmp(eptr, charptr, length) == 0) eptr += length; |
2499 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
2525 |
else break; |
else break; |
2526 |
} |
} |
2527 |
|
|
|
CHECK_PARTIAL(); |
|
2528 |
if (possessive) continue; |
if (possessive) continue; |
2529 |
|
|
2530 |
for(;;) |
for(;;) |
2553 |
/* When not in UTF-8 mode, load a single-byte character. */ |
/* When not in UTF-8 mode, load a single-byte character. */ |
2554 |
|
|
2555 |
fc = *ecode++; |
fc = *ecode++; |
2556 |
|
|
2557 |
/* The value of fc at this point is always less than 256, though we may or |
/* The value of fc at this point is always less than 256, though we may or |
2558 |
may not be in UTF-8 mode. The code is duplicated for the caseless and |
may not be in UTF-8 mode. The code is duplicated for the caseless and |
2559 |
caseful cases, for speed, since matching characters is likely to be quite |
caseful cases, for speed, since matching characters is likely to be quite |
2585 |
{ |
{ |
2586 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM24); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM24); |
2587 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2588 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2589 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2590 |
{ |
{ |
2591 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2604 |
eptr++; |
eptr++; |
2605 |
} |
} |
2606 |
|
|
|
CHECK_PARTIAL(); |
|
2607 |
if (possessive) continue; |
if (possessive) continue; |
2608 |
|
|
2609 |
while (eptr >= pp) |
while (eptr >= pp) |
2630 |
} |
} |
2631 |
if (fc != *eptr++) RRETURN(MATCH_NOMATCH); |
if (fc != *eptr++) RRETURN(MATCH_NOMATCH); |
2632 |
} |
} |
2633 |
|
|
2634 |
if (min == max) continue; |
if (min == max) continue; |
2635 |
|
|
2636 |
if (minimize) |
if (minimize) |
2637 |
{ |
{ |
2638 |
for (fi = min;; fi++) |
for (fi = min;; fi++) |
2639 |
{ |
{ |
2640 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM26); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM26); |
2641 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2642 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2643 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2644 |
{ |
{ |
2645 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2657 |
if (eptr >= md->end_subject || fc != *eptr) break; |
if (eptr >= md->end_subject || fc != *eptr) break; |
2658 |
eptr++; |
eptr++; |
2659 |
} |
} |
|
CHECK_PARTIAL(); |
|
2660 |
if (possessive) continue; |
if (possessive) continue; |
2661 |
|
|
2662 |
while (eptr >= pp) |
while (eptr >= pp) |
2663 |
{ |
{ |
2664 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM27); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM27); |
2674 |
checking can be multibyte. */ |
checking can be multibyte. */ |
2675 |
|
|
2676 |
case OP_NOT: |
case OP_NOT: |
2677 |
if (eptr >= md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr >= md->end_subject) |
2678 |
|
{ |
2679 |
|
SCHECK_PARTIAL(); |
2680 |
|
RRETURN(MATCH_NOMATCH); |
2681 |
|
} |
2682 |
ecode++; |
ecode++; |
2683 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
2684 |
if ((ims & PCRE_CASELESS) != 0) |
if ((ims & PCRE_CASELESS) != 0) |
2821 |
{ |
{ |
2822 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); |
2823 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2824 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2825 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2826 |
{ |
{ |
2827 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2840 |
{ |
{ |
2841 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM29); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM29); |
2842 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2843 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2844 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2845 |
{ |
{ |
2846 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2872 |
if (fc == d) break; |
if (fc == d) break; |
2873 |
eptr += len; |
eptr += len; |
2874 |
} |
} |
|
CHECK_PARTIAL(); |
|
2875 |
if (possessive) continue; |
if (possessive) continue; |
2876 |
for(;;) |
for(;;) |
2877 |
{ |
{ |
2890 |
if (eptr >= md->end_subject || fc == md->lcc[*eptr]) break; |
if (eptr >= md->end_subject || fc == md->lcc[*eptr]) break; |
2891 |
eptr++; |
eptr++; |
2892 |
} |
} |
|
CHECK_PARTIAL(); |
|
2893 |
if (possessive) continue; |
if (possessive) continue; |
2894 |
while (eptr >= pp) |
while (eptr >= pp) |
2895 |
{ |
{ |
2952 |
{ |
{ |
2953 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); |
2954 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2955 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2956 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2957 |
{ |
{ |
2958 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
2970 |
{ |
{ |
2971 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM33); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM33); |
2972 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
2973 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
2974 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
2975 |
{ |
{ |
2976 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
3001 |
if (fc == d) break; |
if (fc == d) break; |
3002 |
eptr += len; |
eptr += len; |
3003 |
} |
} |
|
CHECK_PARTIAL(); |
|
3004 |
if (possessive) continue; |
if (possessive) continue; |
3005 |
for(;;) |
for(;;) |
3006 |
{ |
{ |
3019 |
if (eptr >= md->end_subject || fc == *eptr) break; |
if (eptr >= md->end_subject || fc == *eptr) break; |
3020 |
eptr++; |
eptr++; |
3021 |
} |
} |
|
CHECK_PARTIAL(); |
|
3022 |
if (possessive) continue; |
if (possessive) continue; |
3023 |
while (eptr >= pp) |
while (eptr >= pp) |
3024 |
{ |
{ |
3524 |
break; |
break; |
3525 |
|
|
3526 |
case OP_ALLANY: |
case OP_ALLANY: |
3527 |
if (eptr > md->end_subject - min) RRETURN(MATCH_NOMATCH); |
if (eptr > md->end_subject - min) |
3528 |
|
{ |
3529 |
|
SCHECK_PARTIAL(); |
3530 |
|
RRETURN(MATCH_NOMATCH); |
3531 |
|
} |
3532 |
eptr += min; |
eptr += min; |
3533 |
break; |
break; |
3534 |
|
|
3535 |
case OP_ANYBYTE: |
case OP_ANYBYTE: |
3536 |
if (eptr > md->end_subject - min) RRETURN(MATCH_NOMATCH); |
if (eptr > md->end_subject - min) |
3537 |
|
{ |
3538 |
|
SCHECK_PARTIAL(); |
3539 |
|
RRETURN(MATCH_NOMATCH); |
3540 |
|
} |
3541 |
eptr += min; |
eptr += min; |
3542 |
break; |
break; |
3543 |
|
|
3746 |
{ |
{ |
3747 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM36); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM36); |
3748 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
3749 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
3750 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
3751 |
{ |
{ |
3752 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
3762 |
{ |
{ |
3763 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM37); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM37); |
3764 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
3765 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
3766 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
3767 |
{ |
{ |
3768 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
3782 |
{ |
{ |
3783 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM38); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM38); |
3784 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
3785 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
3786 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
3787 |
{ |
{ |
3788 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
3800 |
{ |
{ |
3801 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39); |
3802 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
3803 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
3804 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
3805 |
{ |
{ |
3806 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
3818 |
{ |
{ |
3819 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM40); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM40); |
3820 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
3821 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
3822 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
3823 |
{ |
{ |
3824 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
3845 |
{ |
{ |
3846 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM41); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM41); |
3847 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
3848 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
3849 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
3850 |
{ |
{ |
3851 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
3877 |
{ |
{ |
3878 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM42); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM42); |
3879 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
3880 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
3881 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
3882 |
{ |
{ |
3883 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
4040 |
{ |
{ |
4041 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM43); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM43); |
4042 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
4043 |
if (fi >= max) |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
|
{ |
|
|
CHECK_PARTIAL(); |
|
|
RRETURN(MATCH_NOMATCH); |
|
|
} |
|
4044 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
4045 |
{ |
{ |
4046 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
4236 |
|
|
4237 |
/* eptr is now past the end of the maximum run */ |
/* eptr is now past the end of the maximum run */ |
4238 |
|
|
|
CHECK_PARTIAL(); |
|
4239 |
if (possessive) continue; |
if (possessive) continue; |
4240 |
for(;;) |
for(;;) |
4241 |
{ |
{ |
4272 |
|
|
4273 |
/* eptr is now past the end of the maximum run */ |
/* eptr is now past the end of the maximum run */ |
4274 |
|
|
|
CHECK_PARTIAL(); |
|
4275 |
if (possessive) continue; |
if (possessive) continue; |
4276 |
for(;;) |
for(;;) |
4277 |
{ |
{ |
4508 |
|
|
4509 |
/* eptr is now past the end of the maximum run */ |
/* eptr is now past the end of the maximum run */ |
4510 |
|
|
|
CHECK_PARTIAL(); |
|
4511 |
if (possessive) continue; |
if (possessive) continue; |
4512 |
for(;;) |
for(;;) |
4513 |
{ |
{ |
4663 |
|
|
4664 |
/* eptr is now past the end of the maximum run */ |
/* eptr is now past the end of the maximum run */ |
4665 |
|
|
|
CHECK_PARTIAL(); |
|
4666 |
if (possessive) continue; |
if (possessive) continue; |
4667 |
while (eptr >= pp) |
while (eptr >= pp) |
4668 |
{ |
{ |