408 |
the subject. */ |
the subject. */ |
409 |
|
|
410 |
#define CHECK_PARTIAL()\ |
#define CHECK_PARTIAL()\ |
411 |
if (md->partial && eptr >= md->end_subject && eptr > mstart)\ |
if (md->partial != 0 && eptr >= md->end_subject && eptr > mstart)\ |
412 |
{\ |
{\ |
413 |
md->hitend = TRUE;\ |
md->hitend = TRUE;\ |
414 |
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);\ |
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);\ |
1024 |
if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); |
if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); |
1025 |
} |
} |
1026 |
|
|
1027 |
/* Skip to next op code */ |
/* Save the earliest consulted character, then skip to next op code */ |
1028 |
|
|
1029 |
|
if (eptr < md->start_used_ptr) md->start_used_ptr = eptr; |
1030 |
ecode += 1 + LINK_SIZE; |
ecode += 1 + LINK_SIZE; |
1031 |
break; |
break; |
1032 |
|
|
1469 |
|
|
1470 |
/* Find out if the previous and current characters are "word" characters. |
/* Find out if the previous and current characters are "word" characters. |
1471 |
It takes a bit more work in UTF-8 mode. Characters > 255 are assumed to |
It takes a bit more work in UTF-8 mode. Characters > 255 are assumed to |
1472 |
be "non-word" characters. */ |
be "non-word" characters. Remember the earliest consulted character for |
1473 |
|
partial matching. */ |
1474 |
|
|
1475 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
1476 |
if (utf8) |
if (utf8) |
1479 |
{ |
{ |
1480 |
USPTR lastptr = eptr - 1; |
USPTR lastptr = eptr - 1; |
1481 |
while((*lastptr & 0xc0) == 0x80) lastptr--; |
while((*lastptr & 0xc0) == 0x80) lastptr--; |
1482 |
|
if (lastptr < md->start_used_ptr) md->start_used_ptr = lastptr; |
1483 |
GETCHAR(c, lastptr); |
GETCHAR(c, lastptr); |
1484 |
prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; |
prev_is_word = c < 256 && (md->ctypes[c] & ctype_word) != 0; |
1485 |
} |
} |
1500 |
/* Not in UTF-8 mode */ |
/* Not in UTF-8 mode */ |
1501 |
|
|
1502 |
{ |
{ |
1503 |
prev_is_word = (eptr != md->start_subject) && |
if (eptr == md->start_subject) prev_is_word = FALSE; else |
1504 |
((md->ctypes[eptr[-1]] & ctype_word) != 0); |
{ |
1505 |
|
if (eptr <= md->start_used_ptr) md->start_used_ptr = eptr - 1; |
1506 |
|
prev_is_word = ((md->ctypes[eptr[-1]] & ctype_word) != 0); |
1507 |
|
} |
1508 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
1509 |
{ |
{ |
1510 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
5283 |
first starting point for which a partial match was found. */ |
first starting point for which a partial match was found. */ |
5284 |
|
|
5285 |
md->start_match_ptr = start_match; |
md->start_match_ptr = start_match; |
5286 |
|
md->start_used_ptr = start_match; |
5287 |
md->match_call_count = 0; |
md->match_call_count = 0; |
5288 |
rc = match(start_match, md->start_code, start_match, 2, md, ims, NULL, 0, 0); |
rc = match(start_match, md->start_code, start_match, 2, md, ims, NULL, 0, 0); |
5289 |
if (md->hitend && start_partial == NULL) start_partial = start_match; |
if (md->hitend && start_partial == NULL) start_partial = md->start_used_ptr; |
5290 |
|
|
5291 |
switch(rc) |
switch(rc) |
5292 |
{ |
{ |