| 71 |
/* Special internal returns from the match() function. Make them sufficiently |
/* Special internal returns from the match() function. Make them sufficiently |
| 72 |
negative to avoid the external error codes. */ |
negative to avoid the external error codes. */ |
| 73 |
|
|
| 74 |
#define MATCH_COMMIT (-999) |
#define MATCH_ACCEPT (-999) |
| 75 |
#define MATCH_PRUNE (-998) |
#define MATCH_COMMIT (-998) |
| 76 |
#define MATCH_SKIP (-997) |
#define MATCH_PRUNE (-997) |
| 77 |
#define MATCH_THEN (-996) |
#define MATCH_SKIP (-996) |
| 78 |
|
#define MATCH_SKIP_ARG (-995) |
| 79 |
|
#define MATCH_THEN (-994) |
| 80 |
|
|
| 81 |
|
/* This is a convenience macro for code that occurs many times. */ |
| 82 |
|
|
| 83 |
|
#define MRRETURN(ra) \ |
| 84 |
|
{ \ |
| 85 |
|
md->mark = markptr; \ |
| 86 |
|
RRETURN(ra); \ |
| 87 |
|
} |
| 88 |
|
|
| 89 |
/* Maximum number of ints of offset to save on the stack for recursive calls. |
/* Maximum number of ints of offset to save on the stack for recursive calls. |
| 90 |
If the offset vector is bigger, malloc is used. This should be a multiple of 3, |
If the offset vector is bigger, malloc is used. This should be a multiple of 3, |
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
#ifdef DEBUG |
#ifdef PCRE_DEBUG |
| 103 |
/************************************************* |
/************************************************* |
| 104 |
* Debugging function to print chars * |
* Debugging function to print chars * |
| 105 |
*************************************************/ |
*************************************************/ |
| 151 |
{ |
{ |
| 152 |
USPTR p = md->start_subject + md->offset_vector[offset]; |
USPTR p = md->start_subject + md->offset_vector[offset]; |
| 153 |
|
|
| 154 |
#ifdef DEBUG |
#ifdef PCRE_DEBUG |
| 155 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 156 |
printf("matching subject <null>"); |
printf("matching subject <null>"); |
| 157 |
else |
else |
| 259 |
|
|
| 260 |
/* These versions of the macros use the stack, as normal. There are debugging |
/* These versions of the macros use the stack, as normal. There are debugging |
| 261 |
versions and production versions. Note that the "rw" argument of RMATCH isn't |
versions and production versions. Note that the "rw" argument of RMATCH isn't |
| 262 |
actuall used in this definition. */ |
actually used in this definition. */ |
| 263 |
|
|
| 264 |
#ifndef NO_RECURSE |
#ifndef NO_RECURSE |
| 265 |
#define REGISTER register |
#define REGISTER register |
| 266 |
|
|
| 267 |
#ifdef DEBUG |
#ifdef PCRE_DEBUG |
| 268 |
#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \ |
#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \ |
| 269 |
{ \ |
{ \ |
| 270 |
printf("match() called in line %d\n", __LINE__); \ |
printf("match() called in line %d\n", __LINE__); \ |
| 271 |
rrc = match(ra,rb,mstart,rc,rd,re,rf,rg,rdepth+1); \ |
rrc = match(ra,rb,mstart,markptr,rc,rd,re,rf,rg,rdepth+1); \ |
| 272 |
printf("to line %d\n", __LINE__); \ |
printf("to line %d\n", __LINE__); \ |
| 273 |
} |
} |
| 274 |
#define RRETURN(ra) \ |
#define RRETURN(ra) \ |
| 278 |
} |
} |
| 279 |
#else |
#else |
| 280 |
#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \ |
#define RMATCH(ra,rb,rc,rd,re,rf,rg,rw) \ |
| 281 |
rrc = match(ra,rb,mstart,rc,rd,re,rf,rg,rdepth+1) |
rrc = match(ra,rb,mstart,markptr,rc,rd,re,rf,rg,rdepth+1) |
| 282 |
#define RRETURN(ra) return ra |
#define RRETURN(ra) return ra |
| 283 |
#endif |
#endif |
| 284 |
|
|
| 298 |
newframe->Xeptr = ra;\ |
newframe->Xeptr = ra;\ |
| 299 |
newframe->Xecode = rb;\ |
newframe->Xecode = rb;\ |
| 300 |
newframe->Xmstart = mstart;\ |
newframe->Xmstart = mstart;\ |
| 301 |
|
newframe->Xmarkptr = markptr;\ |
| 302 |
newframe->Xoffset_top = rc;\ |
newframe->Xoffset_top = rc;\ |
| 303 |
newframe->Xims = re;\ |
newframe->Xims = re;\ |
| 304 |
newframe->Xeptrb = rf;\ |
newframe->Xeptrb = rf;\ |
| 336 |
USPTR Xeptr; |
USPTR Xeptr; |
| 337 |
const uschar *Xecode; |
const uschar *Xecode; |
| 338 |
USPTR Xmstart; |
USPTR Xmstart; |
| 339 |
|
USPTR Xmarkptr; |
| 340 |
int Xoffset_top; |
int Xoffset_top; |
| 341 |
long int Xims; |
long int Xims; |
| 342 |
eptrblock *Xeptrb; |
eptrblock *Xeptrb; |
| 423 |
if (md->partial != 0 && eptr >= md->end_subject && eptr > mstart)\ |
if (md->partial != 0 && eptr >= md->end_subject && eptr > mstart)\ |
| 424 |
{\ |
{\ |
| 425 |
md->hitend = TRUE;\ |
md->hitend = TRUE;\ |
| 426 |
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);\ |
if (md->partial > 1) MRRETURN(PCRE_ERROR_PARTIAL);\ |
| 427 |
} |
} |
| 428 |
|
|
| 429 |
#define SCHECK_PARTIAL()\ |
#define SCHECK_PARTIAL()\ |
| 430 |
if (md->partial != 0 && eptr > mstart)\ |
if (md->partial != 0 && eptr > mstart)\ |
| 431 |
{\ |
{\ |
| 432 |
md->hitend = TRUE;\ |
md->hitend = TRUE;\ |
| 433 |
if (md->partial > 1) RRETURN(PCRE_ERROR_PARTIAL);\ |
if (md->partial > 1) MRRETURN(PCRE_ERROR_PARTIAL);\ |
| 434 |
} |
} |
| 435 |
|
|
| 436 |
|
|
| 444 |
ecode pointer to current position in compiled code |
ecode pointer to current position in compiled code |
| 445 |
mstart pointer to the current match start position (can be modified |
mstart pointer to the current match start position (can be modified |
| 446 |
by encountering \K) |
by encountering \K) |
| 447 |
|
markptr pointer to the most recent MARK name, or NULL |
| 448 |
offset_top current top pointer |
offset_top current top pointer |
| 449 |
md pointer to "static" info for the match |
md pointer to "static" info for the match |
| 450 |
ims current /i, /m, and /s options |
ims current /i, /m, and /s options |
| 458 |
|
|
| 459 |
Returns: MATCH_MATCH if matched ) these values are >= 0 |
Returns: MATCH_MATCH if matched ) these values are >= 0 |
| 460 |
MATCH_NOMATCH if failed to match ) |
MATCH_NOMATCH if failed to match ) |
| 461 |
|
a negative MATCH_xxx value for PRUNE, SKIP, etc |
| 462 |
a negative PCRE_ERROR_xxx value if aborted by an error condition |
a negative PCRE_ERROR_xxx value if aborted by an error condition |
| 463 |
(e.g. stopped by repeated call or recursion limit) |
(e.g. stopped by repeated call or recursion limit) |
| 464 |
*/ |
*/ |
| 465 |
|
|
| 466 |
static int |
static int |
| 467 |
match(REGISTER USPTR eptr, REGISTER const uschar *ecode, USPTR mstart, |
match(REGISTER USPTR eptr, REGISTER const uschar *ecode, USPTR mstart, |
| 468 |
int offset_top, match_data *md, unsigned long int ims, eptrblock *eptrb, |
const uschar *markptr, int offset_top, match_data *md, unsigned long int ims, |
| 469 |
int flags, unsigned int rdepth) |
eptrblock *eptrb, int flags, unsigned int rdepth) |
| 470 |
{ |
{ |
| 471 |
/* These variables do not need to be preserved over recursion in this function, |
/* These variables do not need to be preserved over recursion in this function, |
| 472 |
so they can be ordinary variables in all cases. Mark some of them with |
so they can be ordinary variables in all cases. Mark some of them with |
| 494 |
frame->Xeptr = eptr; |
frame->Xeptr = eptr; |
| 495 |
frame->Xecode = ecode; |
frame->Xecode = ecode; |
| 496 |
frame->Xmstart = mstart; |
frame->Xmstart = mstart; |
| 497 |
|
frame->Xmarkptr = markptr; |
| 498 |
frame->Xoffset_top = offset_top; |
frame->Xoffset_top = offset_top; |
| 499 |
frame->Xims = ims; |
frame->Xims = ims; |
| 500 |
frame->Xeptrb = eptrb; |
frame->Xeptrb = eptrb; |
| 510 |
#define eptr frame->Xeptr |
#define eptr frame->Xeptr |
| 511 |
#define ecode frame->Xecode |
#define ecode frame->Xecode |
| 512 |
#define mstart frame->Xmstart |
#define mstart frame->Xmstart |
| 513 |
|
#define markptr frame->Xmarkptr |
| 514 |
#define offset_top frame->Xoffset_top |
#define offset_top frame->Xoffset_top |
| 515 |
#define ims frame->Xims |
#define ims frame->Xims |
| 516 |
#define eptrb frame->Xeptrb |
#define eptrb frame->Xeptrb |
| 638 |
/* OK, now we can get on with the real code of the function. Recursive calls |
/* OK, now we can get on with the real code of the function. Recursive calls |
| 639 |
are specified by the macro RMATCH and RRETURN is used to return. When |
are specified by the macro RMATCH and RRETURN is used to return. When |
| 640 |
NO_RECURSE is *not* defined, these just turn into a recursive call to match() |
NO_RECURSE is *not* defined, these just turn into a recursive call to match() |
| 641 |
and a "return", respectively (possibly with some debugging if DEBUG is |
and a "return", respectively (possibly with some debugging if PCRE_DEBUG is |
| 642 |
defined). However, RMATCH isn't like a function call because it's quite a |
defined). However, RMATCH isn't like a function call because it's quite a |
| 643 |
complicated macro. It has to be used in one particular way. This shouldn't, |
complicated macro. It has to be used in one particular way. This shouldn't, |
| 644 |
however, impact performance when true recursion is being used. */ |
however, impact performance when true recursion is being used. */ |
| 682 |
|
|
| 683 |
switch(op) |
switch(op) |
| 684 |
{ |
{ |
| 685 |
|
case OP_MARK: |
| 686 |
|
markptr = ecode + 2; |
| 687 |
|
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
| 688 |
|
ims, eptrb, flags, RM51); |
| 689 |
|
|
| 690 |
|
/* A return of MATCH_SKIP_ARG means that matching failed at SKIP with an |
| 691 |
|
argument, and we must check whether that argument matches this MARK's |
| 692 |
|
argument. It is passed back in md->start_match_ptr (an overloading of that |
| 693 |
|
variable). If it does match, we reset that variable to the current subject |
| 694 |
|
position and return MATCH_SKIP. Otherwise, pass back the return code |
| 695 |
|
unaltered. */ |
| 696 |
|
|
| 697 |
|
if (rrc == MATCH_SKIP_ARG && |
| 698 |
|
strcmp((char *)markptr, (char *)(md->start_match_ptr)) == 0) |
| 699 |
|
{ |
| 700 |
|
md->start_match_ptr = eptr; |
| 701 |
|
RRETURN(MATCH_SKIP); |
| 702 |
|
} |
| 703 |
|
|
| 704 |
|
if (md->mark == NULL) md->mark = markptr; |
| 705 |
|
RRETURN(rrc); |
| 706 |
|
|
| 707 |
case OP_FAIL: |
case OP_FAIL: |
| 708 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 709 |
|
|
| 710 |
|
case OP_COMMIT: |
| 711 |
|
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
| 712 |
|
ims, eptrb, flags, RM52); |
| 713 |
|
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 714 |
|
MRRETURN(MATCH_COMMIT); |
| 715 |
|
|
| 716 |
case OP_PRUNE: |
case OP_PRUNE: |
| 717 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
| 718 |
ims, eptrb, flags, RM51); |
ims, eptrb, flags, RM51); |
| 719 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 720 |
RRETURN(MATCH_PRUNE); |
MRRETURN(MATCH_PRUNE); |
| 721 |
|
|
| 722 |
case OP_COMMIT: |
case OP_PRUNE_ARG: |
| 723 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
| 724 |
ims, eptrb, flags, RM52); |
ims, eptrb, flags, RM51); |
| 725 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 726 |
RRETURN(MATCH_COMMIT); |
md->mark = ecode + 2; |
| 727 |
|
RRETURN(MATCH_PRUNE); |
| 728 |
|
|
| 729 |
case OP_SKIP: |
case OP_SKIP: |
| 730 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
| 731 |
ims, eptrb, flags, RM53); |
ims, eptrb, flags, RM53); |
| 732 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 733 |
md->start_match_ptr = eptr; /* Pass back current position */ |
md->start_match_ptr = eptr; /* Pass back current position */ |
| 734 |
RRETURN(MATCH_SKIP); |
MRRETURN(MATCH_SKIP); |
| 735 |
|
|
| 736 |
|
case OP_SKIP_ARG: |
| 737 |
|
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
| 738 |
|
ims, eptrb, flags, RM53); |
| 739 |
|
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 740 |
|
|
| 741 |
|
/* Pass back the current skip name by overloading md->start_match_ptr and |
| 742 |
|
returning the special MATCH_SKIP_ARG return code. This will either be |
| 743 |
|
caught by a matching MARK, or get to the top, where it is treated the same |
| 744 |
|
as PRUNE. */ |
| 745 |
|
|
| 746 |
|
md->start_match_ptr = ecode + 2; |
| 747 |
|
RRETURN(MATCH_SKIP_ARG); |
| 748 |
|
|
| 749 |
case OP_THEN: |
case OP_THEN: |
| 750 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, |
| 751 |
ims, eptrb, flags, RM54); |
ims, eptrb, flags, RM54); |
| 752 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 753 |
|
MRRETURN(MATCH_THEN); |
| 754 |
|
|
| 755 |
|
case OP_THEN_ARG: |
| 756 |
|
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode] + ecode[1], offset_top, md, |
| 757 |
|
ims, eptrb, flags, RM54); |
| 758 |
|
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 759 |
|
md->mark = ecode + 2; |
| 760 |
RRETURN(MATCH_THEN); |
RRETURN(MATCH_THEN); |
| 761 |
|
|
| 762 |
/* Handle a capturing bracket. If there is space in the offset vector, save |
/* Handle a capturing bracket. If there is space in the offset vector, save |
| 778 |
number = GET2(ecode, 1+LINK_SIZE); |
number = GET2(ecode, 1+LINK_SIZE); |
| 779 |
offset = number << 1; |
offset = number << 1; |
| 780 |
|
|
| 781 |
#ifdef DEBUG |
#ifdef PCRE_DEBUG |
| 782 |
printf("start bracket %d\n", number); |
printf("start bracket %d\n", number); |
| 783 |
printf("subject="); |
printf("subject="); |
| 784 |
pchars(eptr, 16, TRUE, md); |
pchars(eptr, 16, TRUE, md); |
| 812 |
md->offset_vector[offset+1] = save_offset2; |
md->offset_vector[offset+1] = save_offset2; |
| 813 |
md->offset_vector[md->offset_end - number] = save_offset3; |
md->offset_vector[md->offset_end - number] = save_offset3; |
| 814 |
|
|
| 815 |
|
if (rrc != MATCH_THEN) md->mark = markptr; |
| 816 |
RRETURN(MATCH_NOMATCH); |
RRETURN(MATCH_NOMATCH); |
| 817 |
} |
} |
| 818 |
|
|
| 852 |
|
|
| 853 |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims, |
RMATCH(eptr, ecode + _pcre_OP_lengths[*ecode], offset_top, md, ims, |
| 854 |
eptrb, flags, RM48); |
eptrb, flags, RM48); |
| 855 |
RRETURN(rrc); |
if (rrc == MATCH_NOMATCH) md->mark = markptr; |
| 856 |
|
RRETURN(rrc); |
| 857 |
} |
} |
| 858 |
|
|
| 859 |
/* For non-final alternatives, continue the loop for a NOMATCH result; |
/* For non-final alternatives, continue the loop for a NOMATCH result; |
| 896 |
cb.capture_top = offset_top/2; |
cb.capture_top = offset_top/2; |
| 897 |
cb.capture_last = md->capture_last; |
cb.capture_last = md->capture_last; |
| 898 |
cb.callout_data = md->callout_data; |
cb.callout_data = md->callout_data; |
| 899 |
if ((rrc = (*pcre_callout)(&cb)) > 0) RRETURN(MATCH_NOMATCH); |
if ((rrc = (*pcre_callout)(&cb)) > 0) MRRETURN(MATCH_NOMATCH); |
| 900 |
if (rrc < 0) RRETURN(rrc); |
if (rrc < 0) RRETURN(rrc); |
| 901 |
} |
} |
| 902 |
ecode += _pcre_OP_lengths[OP_CALLOUT]; |
ecode += _pcre_OP_lengths[OP_CALLOUT]; |
| 1106 |
number = GET2(ecode, 1); |
number = GET2(ecode, 1); |
| 1107 |
offset = number << 1; |
offset = number << 1; |
| 1108 |
|
|
| 1109 |
#ifdef DEBUG |
#ifdef PCRE_DEBUG |
| 1110 |
printf("end bracket %d at *ACCEPT", number); |
printf("end bracket %d at *ACCEPT", number); |
| 1111 |
printf("\n"); |
printf("\n"); |
| 1112 |
#endif |
#endif |
| 1137 |
memmove(md->offset_vector, rec->offset_save, |
memmove(md->offset_vector, rec->offset_save, |
| 1138 |
rec->saved_max * sizeof(int)); |
rec->saved_max * sizeof(int)); |
| 1139 |
offset_top = rec->save_offset_top; |
offset_top = rec->save_offset_top; |
|
mstart = rec->save_start; |
|
| 1140 |
ims = original_ims; |
ims = original_ims; |
| 1141 |
ecode = rec->after_call; |
ecode = rec->after_call; |
| 1142 |
break; |
break; |
| 1151 |
(md->notempty || |
(md->notempty || |
| 1152 |
(md->notempty_atstart && |
(md->notempty_atstart && |
| 1153 |
mstart == md->start_subject + md->start_offset))) |
mstart == md->start_subject + md->start_offset))) |
| 1154 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1155 |
|
|
| 1156 |
/* Otherwise, we have a match. */ |
/* Otherwise, we have a match. */ |
| 1157 |
|
|
| 1158 |
md->end_match_ptr = eptr; /* Record where we ended */ |
md->end_match_ptr = eptr; /* Record where we ended */ |
| 1159 |
md->end_offset_top = offset_top; /* and how many extracts were taken */ |
md->end_offset_top = offset_top; /* and how many extracts were taken */ |
| 1160 |
md->start_match_ptr = mstart; /* and the start (\K can modify) */ |
md->start_match_ptr = mstart; /* and the start (\K can modify) */ |
| 1161 |
RRETURN(MATCH_MATCH); |
MRRETURN(((op == OP_END)? MATCH_MATCH : MATCH_ACCEPT)); |
| 1162 |
|
|
| 1163 |
/* Change option settings */ |
/* Change option settings */ |
| 1164 |
|
|
| 1180 |
{ |
{ |
| 1181 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
| 1182 |
RM4); |
RM4); |
| 1183 |
if (rrc == MATCH_MATCH) break; |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) |
| 1184 |
|
{ |
| 1185 |
|
mstart = md->start_match_ptr; /* In case \K reset it */ |
| 1186 |
|
break; |
| 1187 |
|
} |
| 1188 |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
| 1189 |
ecode += GET(ecode, 1); |
ecode += GET(ecode, 1); |
| 1190 |
} |
} |
| 1191 |
while (*ecode == OP_ALT); |
while (*ecode == OP_ALT); |
| 1192 |
if (*ecode == OP_KET) RRETURN(MATCH_NOMATCH); |
if (*ecode == OP_KET) MRRETURN(MATCH_NOMATCH); |
| 1193 |
|
|
| 1194 |
/* If checking an assertion for a condition, return MATCH_MATCH. */ |
/* If checking an assertion for a condition, return MATCH_MATCH. */ |
| 1195 |
|
|
| 1204 |
continue; |
continue; |
| 1205 |
|
|
| 1206 |
/* Negative assertion: all branches must fail to match. Encountering SKIP, |
/* Negative assertion: all branches must fail to match. Encountering SKIP, |
| 1207 |
PRUNE, or COMMIT means we must assume failure without checking subsequent |
PRUNE, or COMMIT means we must assume failure without checking subsequent |
| 1208 |
branches. */ |
branches. */ |
| 1209 |
|
|
| 1210 |
case OP_ASSERT_NOT: |
case OP_ASSERT_NOT: |
| 1213 |
{ |
{ |
| 1214 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, NULL, 0, |
| 1215 |
RM5); |
RM5); |
| 1216 |
if (rrc == MATCH_MATCH) RRETURN(MATCH_NOMATCH); |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) MRRETURN(MATCH_NOMATCH); |
| 1217 |
if (rrc == MATCH_SKIP || rrc == MATCH_PRUNE || rrc == MATCH_COMMIT) |
if (rrc == MATCH_SKIP || rrc == MATCH_PRUNE || rrc == MATCH_COMMIT) |
| 1218 |
{ |
{ |
| 1219 |
do ecode += GET(ecode,1); while (*ecode == OP_ALT); |
do ecode += GET(ecode,1); while (*ecode == OP_ALT); |
| 1220 |
break; |
break; |
| 1221 |
} |
} |
| 1222 |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
| 1223 |
ecode += GET(ecode,1); |
ecode += GET(ecode,1); |
| 1224 |
} |
} |
| 1242 |
while (i-- > 0) |
while (i-- > 0) |
| 1243 |
{ |
{ |
| 1244 |
eptr--; |
eptr--; |
| 1245 |
if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); |
if (eptr < md->start_subject) MRRETURN(MATCH_NOMATCH); |
| 1246 |
BACKCHAR(eptr); |
BACKCHAR(eptr); |
| 1247 |
} |
} |
| 1248 |
} |
} |
| 1253 |
|
|
| 1254 |
{ |
{ |
| 1255 |
eptr -= GET(ecode, 1); |
eptr -= GET(ecode, 1); |
| 1256 |
if (eptr < md->start_subject) RRETURN(MATCH_NOMATCH); |
if (eptr < md->start_subject) MRRETURN(MATCH_NOMATCH); |
| 1257 |
} |
} |
| 1258 |
|
|
| 1259 |
/* Save the earliest consulted character, then skip to next op code */ |
/* Save the earliest consulted character, then skip to next op code */ |
| 1282 |
cb.capture_top = offset_top/2; |
cb.capture_top = offset_top/2; |
| 1283 |
cb.capture_last = md->capture_last; |
cb.capture_last = md->capture_last; |
| 1284 |
cb.callout_data = md->callout_data; |
cb.callout_data = md->callout_data; |
| 1285 |
if ((rrc = (*pcre_callout)(&cb)) > 0) RRETURN(MATCH_NOMATCH); |
if ((rrc = (*pcre_callout)(&cb)) > 0) MRRETURN(MATCH_NOMATCH); |
| 1286 |
if (rrc < 0) RRETURN(rrc); |
if (rrc < 0) RRETURN(rrc); |
| 1287 |
} |
} |
| 1288 |
ecode += 2 + 2*LINK_SIZE; |
ecode += 2 + 2*LINK_SIZE; |
| 1337 |
|
|
| 1338 |
memcpy(new_recursive.offset_save, md->offset_vector, |
memcpy(new_recursive.offset_save, md->offset_vector, |
| 1339 |
new_recursive.saved_max * sizeof(int)); |
new_recursive.saved_max * sizeof(int)); |
|
new_recursive.save_start = mstart; |
|
| 1340 |
new_recursive.save_offset_top = offset_top; |
new_recursive.save_offset_top = offset_top; |
|
mstart = eptr; |
|
| 1341 |
|
|
| 1342 |
/* OK, now we can do the recursion. For each top-level alternative we |
/* OK, now we can do the recursion. For each top-level alternative we |
| 1343 |
restore the offset and recursion data. */ |
restore the offset and recursion data. */ |
| 1348 |
{ |
{ |
| 1349 |
RMATCH(eptr, callpat + _pcre_OP_lengths[*callpat], offset_top, |
RMATCH(eptr, callpat + _pcre_OP_lengths[*callpat], offset_top, |
| 1350 |
md, ims, eptrb, flags, RM6); |
md, ims, eptrb, flags, RM6); |
| 1351 |
if (rrc == MATCH_MATCH) |
if (rrc == MATCH_MATCH || rrc == MATCH_ACCEPT) |
| 1352 |
{ |
{ |
| 1353 |
DPRINTF(("Recursion matched\n")); |
DPRINTF(("Recursion matched\n")); |
| 1354 |
md->recursive = new_recursive.prevrec; |
md->recursive = new_recursive.prevrec; |
| 1355 |
if (new_recursive.offset_save != stacksave) |
if (new_recursive.offset_save != stacksave) |
| 1356 |
(pcre_free)(new_recursive.offset_save); |
(pcre_free)(new_recursive.offset_save); |
| 1357 |
RRETURN(MATCH_MATCH); |
MRRETURN(MATCH_MATCH); |
| 1358 |
} |
} |
| 1359 |
else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) |
else if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) |
| 1360 |
{ |
{ |
| 1375 |
md->recursive = new_recursive.prevrec; |
md->recursive = new_recursive.prevrec; |
| 1376 |
if (new_recursive.offset_save != stacksave) |
if (new_recursive.offset_save != stacksave) |
| 1377 |
(pcre_free)(new_recursive.offset_save); |
(pcre_free)(new_recursive.offset_save); |
| 1378 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1379 |
} |
} |
| 1380 |
/* Control never reaches here */ |
/* Control never reaches here */ |
| 1381 |
|
|
| 1384 |
a move back into the brackets. Friedl calls these "atomic" subpatterns. |
a move back into the brackets. Friedl calls these "atomic" subpatterns. |
| 1385 |
Check the alternative branches in turn - the matching won't pass the KET |
Check the alternative branches in turn - the matching won't pass the KET |
| 1386 |
for this kind of subpattern. If any one branch matches, we carry on as at |
for this kind of subpattern. If any one branch matches, we carry on as at |
| 1387 |
the end of a normal bracket, leaving the subject pointer. */ |
the end of a normal bracket, leaving the subject pointer, but resetting |
| 1388 |
|
the start-of-match value in case it was changed by \K. */ |
| 1389 |
|
|
| 1390 |
case OP_ONCE: |
case OP_ONCE: |
| 1391 |
prev = ecode; |
prev = ecode; |
| 1394 |
do |
do |
| 1395 |
{ |
{ |
| 1396 |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM7); |
RMATCH(eptr, ecode + 1 + LINK_SIZE, offset_top, md, ims, eptrb, 0, RM7); |
| 1397 |
if (rrc == MATCH_MATCH) break; |
if (rrc == MATCH_MATCH) /* Note: _not_ MATCH_ACCEPT */ |
| 1398 |
|
{ |
| 1399 |
|
mstart = md->start_match_ptr; |
| 1400 |
|
break; |
| 1401 |
|
} |
| 1402 |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH && rrc != MATCH_THEN) RRETURN(rrc); |
| 1403 |
ecode += GET(ecode,1); |
ecode += GET(ecode,1); |
| 1404 |
} |
} |
| 1517 |
} |
} |
| 1518 |
else saved_eptr = NULL; |
else saved_eptr = NULL; |
| 1519 |
|
|
| 1520 |
/* If we are at the end of an assertion group, stop matching and return |
/* If we are at the end of an assertion group or an atomic group, stop |
| 1521 |
MATCH_MATCH, but record the current high water mark for use by positive |
matching and return MATCH_MATCH, but record the current high water mark for |
| 1522 |
assertions. Do this also for the "once" (atomic) groups. */ |
use by positive assertions. We also need to record the match start in case |
| 1523 |
|
it was changed by \K. */ |
| 1524 |
|
|
| 1525 |
if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT || |
if (*prev == OP_ASSERT || *prev == OP_ASSERT_NOT || |
| 1526 |
*prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT || |
*prev == OP_ASSERTBACK || *prev == OP_ASSERTBACK_NOT || |
| 1528 |
{ |
{ |
| 1529 |
md->end_match_ptr = eptr; /* For ONCE */ |
md->end_match_ptr = eptr; /* For ONCE */ |
| 1530 |
md->end_offset_top = offset_top; |
md->end_offset_top = offset_top; |
| 1531 |
RRETURN(MATCH_MATCH); |
md->start_match_ptr = mstart; |
| 1532 |
|
MRRETURN(MATCH_MATCH); |
| 1533 |
} |
} |
| 1534 |
|
|
| 1535 |
/* For capturing groups we have to check the group number back at the start |
/* For capturing groups we have to check the group number back at the start |
| 1543 |
number = GET2(prev, 1+LINK_SIZE); |
number = GET2(prev, 1+LINK_SIZE); |
| 1544 |
offset = number << 1; |
offset = number << 1; |
| 1545 |
|
|
| 1546 |
#ifdef DEBUG |
#ifdef PCRE_DEBUG |
| 1547 |
printf("end bracket %d", number); |
printf("end bracket %d", number); |
| 1548 |
printf("\n"); |
printf("\n"); |
| 1549 |
#endif |
#endif |
| 1565 |
recursion_info *rec = md->recursive; |
recursion_info *rec = md->recursive; |
| 1566 |
DPRINTF(("Recursion (%d) succeeded - continuing\n", number)); |
DPRINTF(("Recursion (%d) succeeded - continuing\n", number)); |
| 1567 |
md->recursive = rec->prevrec; |
md->recursive = rec->prevrec; |
|
mstart = rec->save_start; |
|
| 1568 |
memcpy(md->offset_vector, rec->offset_save, |
memcpy(md->offset_vector, rec->offset_save, |
| 1569 |
rec->saved_max * sizeof(int)); |
rec->saved_max * sizeof(int)); |
| 1570 |
offset_top = rec->save_offset_top; |
offset_top = rec->save_offset_top; |
| 1624 |
/* Start of subject unless notbol, or after internal newline if multiline */ |
/* Start of subject unless notbol, or after internal newline if multiline */ |
| 1625 |
|
|
| 1626 |
case OP_CIRC: |
case OP_CIRC: |
| 1627 |
if (md->notbol && eptr == md->start_subject) RRETURN(MATCH_NOMATCH); |
if (md->notbol && eptr == md->start_subject) MRRETURN(MATCH_NOMATCH); |
| 1628 |
if ((ims & PCRE_MULTILINE) != 0) |
if ((ims & PCRE_MULTILINE) != 0) |
| 1629 |
{ |
{ |
| 1630 |
if (eptr != md->start_subject && |
if (eptr != md->start_subject && |
| 1631 |
(eptr == md->end_subject || !WAS_NEWLINE(eptr))) |
(eptr == md->end_subject || !WAS_NEWLINE(eptr))) |
| 1632 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1633 |
ecode++; |
ecode++; |
| 1634 |
break; |
break; |
| 1635 |
} |
} |
| 1638 |
/* Start of subject assertion */ |
/* Start of subject assertion */ |
| 1639 |
|
|
| 1640 |
case OP_SOD: |
case OP_SOD: |
| 1641 |
if (eptr != md->start_subject) RRETURN(MATCH_NOMATCH); |
if (eptr != md->start_subject) MRRETURN(MATCH_NOMATCH); |
| 1642 |
ecode++; |
ecode++; |
| 1643 |
break; |
break; |
| 1644 |
|
|
| 1645 |
/* Start of match assertion */ |
/* Start of match assertion */ |
| 1646 |
|
|
| 1647 |
case OP_SOM: |
case OP_SOM: |
| 1648 |
if (eptr != md->start_subject + md->start_offset) RRETURN(MATCH_NOMATCH); |
if (eptr != md->start_subject + md->start_offset) MRRETURN(MATCH_NOMATCH); |
| 1649 |
ecode++; |
ecode++; |
| 1650 |
break; |
break; |
| 1651 |
|
|
| 1663 |
if ((ims & PCRE_MULTILINE) != 0) |
if ((ims & PCRE_MULTILINE) != 0) |
| 1664 |
{ |
{ |
| 1665 |
if (eptr < md->end_subject) |
if (eptr < md->end_subject) |
| 1666 |
{ if (!IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); } |
{ if (!IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); } |
| 1667 |
else |
else |
| 1668 |
{ if (md->noteol) RRETURN(MATCH_NOMATCH); } |
{ if (md->noteol) MRRETURN(MATCH_NOMATCH); } |
| 1669 |
ecode++; |
ecode++; |
| 1670 |
break; |
break; |
| 1671 |
} |
} |
| 1672 |
else |
else |
| 1673 |
{ |
{ |
| 1674 |
if (md->noteol) RRETURN(MATCH_NOMATCH); |
if (md->noteol) MRRETURN(MATCH_NOMATCH); |
| 1675 |
if (!md->endonly) |
if (!md->endonly) |
| 1676 |
{ |
{ |
| 1677 |
if (eptr != md->end_subject && |
if (eptr != md->end_subject && |
| 1678 |
(!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen)) |
(!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen)) |
| 1679 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1680 |
ecode++; |
ecode++; |
| 1681 |
break; |
break; |
| 1682 |
} |
} |
| 1686 |
/* End of subject assertion (\z) */ |
/* End of subject assertion (\z) */ |
| 1687 |
|
|
| 1688 |
case OP_EOD: |
case OP_EOD: |
| 1689 |
if (eptr < md->end_subject) RRETURN(MATCH_NOMATCH); |
if (eptr < md->end_subject) MRRETURN(MATCH_NOMATCH); |
| 1690 |
ecode++; |
ecode++; |
| 1691 |
break; |
break; |
| 1692 |
|
|
| 1695 |
case OP_EODN: |
case OP_EODN: |
| 1696 |
if (eptr != md->end_subject && |
if (eptr != md->end_subject && |
| 1697 |
(!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen)) |
(!IS_NEWLINE(eptr) || eptr != md->end_subject - md->nllen)) |
| 1698 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1699 |
ecode++; |
ecode++; |
| 1700 |
break; |
break; |
| 1701 |
|
|
| 1755 |
|
|
| 1756 |
if ((*ecode++ == OP_WORD_BOUNDARY)? |
if ((*ecode++ == OP_WORD_BOUNDARY)? |
| 1757 |
cur_is_word == prev_is_word : cur_is_word != prev_is_word) |
cur_is_word == prev_is_word : cur_is_word != prev_is_word) |
| 1758 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1759 |
} |
} |
| 1760 |
break; |
break; |
| 1761 |
|
|
| 1762 |
/* Match a single character type; inline for speed */ |
/* Match a single character type; inline for speed */ |
| 1763 |
|
|
| 1764 |
case OP_ANY: |
case OP_ANY: |
| 1765 |
if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); |
if (IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); |
| 1766 |
/* Fall through */ |
/* Fall through */ |
| 1767 |
|
|
| 1768 |
case OP_ALLANY: |
case OP_ALLANY: |
| 1769 |
if (eptr++ >= md->end_subject) |
if (eptr++ >= md->end_subject) |
| 1770 |
{ |
{ |
| 1771 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1772 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1773 |
} |
} |
| 1774 |
if (utf8) while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
if (utf8) while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
| 1775 |
ecode++; |
ecode++; |
| 1782 |
if (eptr++ >= md->end_subject) |
if (eptr++ >= md->end_subject) |
| 1783 |
{ |
{ |
| 1784 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1785 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1786 |
} |
} |
| 1787 |
ecode++; |
ecode++; |
| 1788 |
break; |
break; |
| 1791 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1792 |
{ |
{ |
| 1793 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1794 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1795 |
} |
} |
| 1796 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1797 |
if ( |
if ( |
| 1800 |
#endif |
#endif |
| 1801 |
(md->ctypes[c] & ctype_digit) != 0 |
(md->ctypes[c] & ctype_digit) != 0 |
| 1802 |
) |
) |
| 1803 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1804 |
ecode++; |
ecode++; |
| 1805 |
break; |
break; |
| 1806 |
|
|
| 1808 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1809 |
{ |
{ |
| 1810 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1811 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1812 |
} |
} |
| 1813 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1814 |
if ( |
if ( |
| 1817 |
#endif |
#endif |
| 1818 |
(md->ctypes[c] & ctype_digit) == 0 |
(md->ctypes[c] & ctype_digit) == 0 |
| 1819 |
) |
) |
| 1820 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1821 |
ecode++; |
ecode++; |
| 1822 |
break; |
break; |
| 1823 |
|
|
| 1825 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1826 |
{ |
{ |
| 1827 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1828 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1829 |
} |
} |
| 1830 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1831 |
if ( |
if ( |
| 1834 |
#endif |
#endif |
| 1835 |
(md->ctypes[c] & ctype_space) != 0 |
(md->ctypes[c] & ctype_space) != 0 |
| 1836 |
) |
) |
| 1837 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1838 |
ecode++; |
ecode++; |
| 1839 |
break; |
break; |
| 1840 |
|
|
| 1842 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1843 |
{ |
{ |
| 1844 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1845 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1846 |
} |
} |
| 1847 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1848 |
if ( |
if ( |
| 1851 |
#endif |
#endif |
| 1852 |
(md->ctypes[c] & ctype_space) == 0 |
(md->ctypes[c] & ctype_space) == 0 |
| 1853 |
) |
) |
| 1854 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1855 |
ecode++; |
ecode++; |
| 1856 |
break; |
break; |
| 1857 |
|
|
| 1859 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1860 |
{ |
{ |
| 1861 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1862 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1863 |
} |
} |
| 1864 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1865 |
if ( |
if ( |
| 1868 |
#endif |
#endif |
| 1869 |
(md->ctypes[c] & ctype_word) != 0 |
(md->ctypes[c] & ctype_word) != 0 |
| 1870 |
) |
) |
| 1871 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1872 |
ecode++; |
ecode++; |
| 1873 |
break; |
break; |
| 1874 |
|
|
| 1876 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1877 |
{ |
{ |
| 1878 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1879 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1880 |
} |
} |
| 1881 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1882 |
if ( |
if ( |
| 1885 |
#endif |
#endif |
| 1886 |
(md->ctypes[c] & ctype_word) == 0 |
(md->ctypes[c] & ctype_word) == 0 |
| 1887 |
) |
) |
| 1888 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1889 |
ecode++; |
ecode++; |
| 1890 |
break; |
break; |
| 1891 |
|
|
| 1893 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1894 |
{ |
{ |
| 1895 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1896 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1897 |
} |
} |
| 1898 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1899 |
switch(c) |
switch(c) |
| 1900 |
{ |
{ |
| 1901 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 1902 |
case 0x000d: |
case 0x000d: |
| 1903 |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
| 1904 |
break; |
break; |
| 1911 |
case 0x0085: |
case 0x0085: |
| 1912 |
case 0x2028: |
case 0x2028: |
| 1913 |
case 0x2029: |
case 0x2029: |
| 1914 |
if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); |
if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); |
| 1915 |
break; |
break; |
| 1916 |
} |
} |
| 1917 |
ecode++; |
ecode++; |
| 1921 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1922 |
{ |
{ |
| 1923 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1924 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1925 |
} |
} |
| 1926 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1927 |
switch(c) |
switch(c) |
| 1946 |
case 0x202f: /* NARROW NO-BREAK SPACE */ |
case 0x202f: /* NARROW NO-BREAK SPACE */ |
| 1947 |
case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ |
case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ |
| 1948 |
case 0x3000: /* IDEOGRAPHIC SPACE */ |
case 0x3000: /* IDEOGRAPHIC SPACE */ |
| 1949 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1950 |
} |
} |
| 1951 |
ecode++; |
ecode++; |
| 1952 |
break; |
break; |
| 1955 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1956 |
{ |
{ |
| 1957 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1958 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1959 |
} |
} |
| 1960 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1961 |
switch(c) |
switch(c) |
| 1962 |
{ |
{ |
| 1963 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 1964 |
case 0x09: /* HT */ |
case 0x09: /* HT */ |
| 1965 |
case 0x20: /* SPACE */ |
case 0x20: /* SPACE */ |
| 1966 |
case 0xa0: /* NBSP */ |
case 0xa0: /* NBSP */ |
| 1989 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 1990 |
{ |
{ |
| 1991 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 1992 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 1993 |
} |
} |
| 1994 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 1995 |
switch(c) |
switch(c) |
| 2002 |
case 0x85: /* NEL */ |
case 0x85: /* NEL */ |
| 2003 |
case 0x2028: /* LINE SEPARATOR */ |
case 0x2028: /* LINE SEPARATOR */ |
| 2004 |
case 0x2029: /* PARAGRAPH SEPARATOR */ |
case 0x2029: /* PARAGRAPH SEPARATOR */ |
| 2005 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2006 |
} |
} |
| 2007 |
ecode++; |
ecode++; |
| 2008 |
break; |
break; |
| 2011 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2012 |
{ |
{ |
| 2013 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2014 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2015 |
} |
} |
| 2016 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2017 |
switch(c) |
switch(c) |
| 2018 |
{ |
{ |
| 2019 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 2020 |
case 0x0a: /* LF */ |
case 0x0a: /* LF */ |
| 2021 |
case 0x0b: /* VT */ |
case 0x0b: /* VT */ |
| 2022 |
case 0x0c: /* FF */ |
case 0x0c: /* FF */ |
| 2038 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2039 |
{ |
{ |
| 2040 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2041 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2042 |
} |
} |
| 2043 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2044 |
{ |
{ |
| 2047 |
switch(ecode[1]) |
switch(ecode[1]) |
| 2048 |
{ |
{ |
| 2049 |
case PT_ANY: |
case PT_ANY: |
| 2050 |
if (op == OP_NOTPROP) RRETURN(MATCH_NOMATCH); |
if (op == OP_NOTPROP) MRRETURN(MATCH_NOMATCH); |
| 2051 |
break; |
break; |
| 2052 |
|
|
| 2053 |
case PT_LAMP: |
case PT_LAMP: |
| 2054 |
if ((prop->chartype == ucp_Lu || |
if ((prop->chartype == ucp_Lu || |
| 2055 |
prop->chartype == ucp_Ll || |
prop->chartype == ucp_Ll || |
| 2056 |
prop->chartype == ucp_Lt) == (op == OP_NOTPROP)) |
prop->chartype == ucp_Lt) == (op == OP_NOTPROP)) |
| 2057 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2058 |
break; |
break; |
| 2059 |
|
|
| 2060 |
case PT_GC: |
case PT_GC: |
| 2061 |
if ((ecode[2] != _pcre_ucp_gentype[prop->chartype]) == (op == OP_PROP)) |
if ((ecode[2] != _pcre_ucp_gentype[prop->chartype]) == (op == OP_PROP)) |
| 2062 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2063 |
break; |
break; |
| 2064 |
|
|
| 2065 |
case PT_PC: |
case PT_PC: |
| 2066 |
if ((ecode[2] != prop->chartype) == (op == OP_PROP)) |
if ((ecode[2] != prop->chartype) == (op == OP_PROP)) |
| 2067 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2068 |
break; |
break; |
| 2069 |
|
|
| 2070 |
case PT_SC: |
case PT_SC: |
| 2071 |
if ((ecode[2] != prop->script) == (op == OP_PROP)) |
if ((ecode[2] != prop->script) == (op == OP_PROP)) |
| 2072 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2073 |
break; |
break; |
| 2074 |
|
|
| 2075 |
default: |
default: |
| 2087 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2088 |
{ |
{ |
| 2089 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2090 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2091 |
} |
} |
| 2092 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2093 |
{ |
{ |
| 2094 |
int category = UCD_CATEGORY(c); |
int category = UCD_CATEGORY(c); |
| 2095 |
if (category == ucp_M) RRETURN(MATCH_NOMATCH); |
if (category == ucp_M) MRRETURN(MATCH_NOMATCH); |
| 2096 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
| 2097 |
{ |
{ |
| 2098 |
int len = 1; |
int len = 1; |
| 2171 |
if (!match_ref(offset, eptr, length, md, ims)) |
if (!match_ref(offset, eptr, length, md, ims)) |
| 2172 |
{ |
{ |
| 2173 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
| 2174 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2175 |
} |
} |
| 2176 |
eptr += length; |
eptr += length; |
| 2177 |
continue; /* With the main loop */ |
continue; /* With the main loop */ |
| 2191 |
if (!match_ref(offset, eptr, length, md, ims)) |
if (!match_ref(offset, eptr, length, md, ims)) |
| 2192 |
{ |
{ |
| 2193 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
| 2194 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2195 |
} |
} |
| 2196 |
eptr += length; |
eptr += length; |
| 2197 |
} |
} |
| 2209 |
{ |
{ |
| 2210 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM14); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM14); |
| 2211 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2212 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2213 |
if (!match_ref(offset, eptr, length, md, ims)) |
if (!match_ref(offset, eptr, length, md, ims)) |
| 2214 |
{ |
{ |
| 2215 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
| 2216 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2217 |
} |
} |
| 2218 |
eptr += length; |
eptr += length; |
| 2219 |
} |
} |
| 2240 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2241 |
eptr -= length; |
eptr -= length; |
| 2242 |
} |
} |
| 2243 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2244 |
} |
} |
| 2245 |
} |
} |
| 2246 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2302 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2303 |
{ |
{ |
| 2304 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2305 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2306 |
} |
} |
| 2307 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 2308 |
if (c > 255) |
if (c > 255) |
| 2309 |
{ |
{ |
| 2310 |
if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); |
if (op == OP_CLASS) MRRETURN(MATCH_NOMATCH); |
| 2311 |
} |
} |
| 2312 |
else |
else |
| 2313 |
{ |
{ |
| 2314 |
if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); |
if ((data[c/8] & (1 << (c&7))) == 0) MRRETURN(MATCH_NOMATCH); |
| 2315 |
} |
} |
| 2316 |
} |
} |
| 2317 |
} |
} |
| 2324 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2325 |
{ |
{ |
| 2326 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2327 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2328 |
} |
} |
| 2329 |
c = *eptr++; |
c = *eptr++; |
| 2330 |
if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); |
if ((data[c/8] & (1 << (c&7))) == 0) MRRETURN(MATCH_NOMATCH); |
| 2331 |
} |
} |
| 2332 |
} |
} |
| 2333 |
|
|
| 2349 |
{ |
{ |
| 2350 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM16); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM16); |
| 2351 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2352 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2353 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2354 |
{ |
{ |
| 2355 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2356 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2357 |
} |
} |
| 2358 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 2359 |
if (c > 255) |
if (c > 255) |
| 2360 |
{ |
{ |
| 2361 |
if (op == OP_CLASS) RRETURN(MATCH_NOMATCH); |
if (op == OP_CLASS) MRRETURN(MATCH_NOMATCH); |
| 2362 |
} |
} |
| 2363 |
else |
else |
| 2364 |
{ |
{ |
| 2365 |
if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); |
if ((data[c/8] & (1 << (c&7))) == 0) MRRETURN(MATCH_NOMATCH); |
| 2366 |
} |
} |
| 2367 |
} |
} |
| 2368 |
} |
} |
| 2374 |
{ |
{ |
| 2375 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM17); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM17); |
| 2376 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2377 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2378 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2379 |
{ |
{ |
| 2380 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2381 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2382 |
} |
} |
| 2383 |
c = *eptr++; |
c = *eptr++; |
| 2384 |
if ((data[c/8] & (1 << (c&7))) == 0) RRETURN(MATCH_NOMATCH); |
if ((data[c/8] & (1 << (c&7))) == 0) MRRETURN(MATCH_NOMATCH); |
| 2385 |
} |
} |
| 2386 |
} |
} |
| 2387 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2447 |
} |
} |
| 2448 |
} |
} |
| 2449 |
|
|
| 2450 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2451 |
} |
} |
| 2452 |
} |
} |
| 2453 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2499 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2500 |
{ |
{ |
| 2501 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2502 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2503 |
} |
} |
| 2504 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2505 |
if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH); |
if (!_pcre_xclass(c, data)) MRRETURN(MATCH_NOMATCH); |
| 2506 |
} |
} |
| 2507 |
|
|
| 2508 |
/* If max == min we can continue with the main loop without the |
/* If max == min we can continue with the main loop without the |
| 2519 |
{ |
{ |
| 2520 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM20); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM20); |
| 2521 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2522 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2523 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2524 |
{ |
{ |
| 2525 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2526 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2527 |
} |
} |
| 2528 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2529 |
if (!_pcre_xclass(c, data)) RRETURN(MATCH_NOMATCH); |
if (!_pcre_xclass(c, data)) MRRETURN(MATCH_NOMATCH); |
| 2530 |
} |
} |
| 2531 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2532 |
} |
} |
| 2555 |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
if (eptr-- == pp) break; /* Stop if tried at original pos */ |
| 2556 |
if (utf8) BACKCHAR(eptr); |
if (utf8) BACKCHAR(eptr); |
| 2557 |
} |
} |
| 2558 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2559 |
} |
} |
| 2560 |
|
|
| 2561 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2574 |
if (length > md->end_subject - eptr) |
if (length > md->end_subject - eptr) |
| 2575 |
{ |
{ |
| 2576 |
CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ |
CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ |
| 2577 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2578 |
} |
} |
| 2579 |
while (length-- > 0) if (*ecode++ != *eptr++) RRETURN(MATCH_NOMATCH); |
while (length-- > 0) if (*ecode++ != *eptr++) MRRETURN(MATCH_NOMATCH); |
| 2580 |
} |
} |
| 2581 |
else |
else |
| 2582 |
#endif |
#endif |
| 2586 |
if (md->end_subject - eptr < 1) |
if (md->end_subject - eptr < 1) |
| 2587 |
{ |
{ |
| 2588 |
SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */ |
SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */ |
| 2589 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2590 |
} |
} |
| 2591 |
if (ecode[1] != *eptr++) RRETURN(MATCH_NOMATCH); |
if (ecode[1] != *eptr++) MRRETURN(MATCH_NOMATCH); |
| 2592 |
ecode += 2; |
ecode += 2; |
| 2593 |
} |
} |
| 2594 |
break; |
break; |
| 2606 |
if (length > md->end_subject - eptr) |
if (length > md->end_subject - eptr) |
| 2607 |
{ |
{ |
| 2608 |
CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ |
CHECK_PARTIAL(); /* Not SCHECK_PARTIAL() */ |
| 2609 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2610 |
} |
} |
| 2611 |
|
|
| 2612 |
/* 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 |
| 2614 |
|
|
| 2615 |
if (fc < 128) |
if (fc < 128) |
| 2616 |
{ |
{ |
| 2617 |
if (md->lcc[*ecode++] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); |
if (md->lcc[*ecode++] != md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); |
| 2618 |
} |
} |
| 2619 |
|
|
| 2620 |
/* Otherwise we must pick up the subject character */ |
/* Otherwise we must pick up the subject character */ |
| 2633 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2634 |
if (dc != UCD_OTHERCASE(fc)) |
if (dc != UCD_OTHERCASE(fc)) |
| 2635 |
#endif |
#endif |
| 2636 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2637 |
} |
} |
| 2638 |
} |
} |
| 2639 |
} |
} |
| 2645 |
if (md->end_subject - eptr < 1) |
if (md->end_subject - eptr < 1) |
| 2646 |
{ |
{ |
| 2647 |
SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */ |
SCHECK_PARTIAL(); /* This one can use SCHECK_PARTIAL() */ |
| 2648 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2649 |
} |
} |
| 2650 |
if (md->lcc[ecode[1]] != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); |
if (md->lcc[ecode[1]] != md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); |
| 2651 |
ecode += 2; |
ecode += 2; |
| 2652 |
} |
} |
| 2653 |
break; |
break; |
| 2741 |
else |
else |
| 2742 |
{ |
{ |
| 2743 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
| 2744 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2745 |
} |
} |
| 2746 |
} |
} |
| 2747 |
|
|
| 2753 |
{ |
{ |
| 2754 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM22); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM22); |
| 2755 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2756 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2757 |
if (eptr <= md->end_subject - length && |
if (eptr <= md->end_subject - length && |
| 2758 |
memcmp(eptr, charptr, length) == 0) eptr += length; |
memcmp(eptr, charptr, length) == 0) eptr += length; |
| 2759 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2764 |
else |
else |
| 2765 |
{ |
{ |
| 2766 |
CHECK_PARTIAL(); |
CHECK_PARTIAL(); |
| 2767 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2768 |
} |
} |
| 2769 |
} |
} |
| 2770 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2795 |
{ |
{ |
| 2796 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM23); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM23); |
| 2797 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2798 |
if (eptr == pp) { RRETURN(MATCH_NOMATCH); } |
if (eptr == pp) { MRRETURN(MATCH_NOMATCH); } |
| 2799 |
#ifdef SUPPORT_UCP |
#ifdef SUPPORT_UCP |
| 2800 |
eptr--; |
eptr--; |
| 2801 |
BACKCHAR(eptr); |
BACKCHAR(eptr); |
| 2838 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2839 |
{ |
{ |
| 2840 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2841 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2842 |
} |
} |
| 2843 |
if (fc != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); |
if (fc != md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); |
| 2844 |
} |
} |
| 2845 |
if (min == max) continue; |
if (min == max) continue; |
| 2846 |
if (minimize) |
if (minimize) |
| 2849 |
{ |
{ |
| 2850 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM24); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM24); |
| 2851 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2852 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2853 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2854 |
{ |
{ |
| 2855 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2856 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2857 |
} |
} |
| 2858 |
if (fc != md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); |
if (fc != md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); |
| 2859 |
} |
} |
| 2860 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2861 |
} |
} |
| 2881 |
eptr--; |
eptr--; |
| 2882 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2883 |
} |
} |
| 2884 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2885 |
} |
} |
| 2886 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2887 |
} |
} |
| 2895 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2896 |
{ |
{ |
| 2897 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2898 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2899 |
} |
} |
| 2900 |
if (fc != *eptr++) RRETURN(MATCH_NOMATCH); |
if (fc != *eptr++) MRRETURN(MATCH_NOMATCH); |
| 2901 |
} |
} |
| 2902 |
|
|
| 2903 |
if (min == max) continue; |
if (min == max) continue; |
| 2908 |
{ |
{ |
| 2909 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM26); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM26); |
| 2910 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2911 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 2912 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2913 |
{ |
{ |
| 2914 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2915 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2916 |
} |
} |
| 2917 |
if (fc != *eptr++) RRETURN(MATCH_NOMATCH); |
if (fc != *eptr++) MRRETURN(MATCH_NOMATCH); |
| 2918 |
} |
} |
| 2919 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2920 |
} |
} |
| 2939 |
eptr--; |
eptr--; |
| 2940 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 2941 |
} |
} |
| 2942 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2943 |
} |
} |
| 2944 |
} |
} |
| 2945 |
/* Control never gets here */ |
/* Control never gets here */ |
| 2951 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 2952 |
{ |
{ |
| 2953 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 2954 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 2955 |
} |
} |
| 2956 |
ecode++; |
ecode++; |
| 2957 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 2961 |
if (c < 256) |
if (c < 256) |
| 2962 |
#endif |
#endif |
| 2963 |
c = md->lcc[c]; |
c = md->lcc[c]; |
| 2964 |
if (md->lcc[*ecode++] == c) RRETURN(MATCH_NOMATCH); |
if (md->lcc[*ecode++] == c) MRRETURN(MATCH_NOMATCH); |
| 2965 |
} |
} |
| 2966 |
else |
else |
| 2967 |
{ |
{ |
| 2968 |
if (*ecode++ == c) RRETURN(MATCH_NOMATCH); |
if (*ecode++ == c) MRRETURN(MATCH_NOMATCH); |
| 2969 |
} |
} |
| 2970 |
break; |
break; |
| 2971 |
|
|
| 3059 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3060 |
{ |
{ |
| 3061 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3062 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3063 |
} |
} |
| 3064 |
GETCHARINC(d, eptr); |
GETCHARINC(d, eptr); |
| 3065 |
if (d < 256) d = md->lcc[d]; |
if (d < 256) d = md->lcc[d]; |
| 3066 |
if (fc == d) RRETURN(MATCH_NOMATCH); |
if (fc == d) MRRETURN(MATCH_NOMATCH); |
| 3067 |
} |
} |
| 3068 |
} |
} |
| 3069 |
else |
else |
| 3076 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3077 |
{ |
{ |
| 3078 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3079 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3080 |
} |
} |
| 3081 |
if (fc == md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); |
if (fc == md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); |
| 3082 |
} |
} |
| 3083 |
} |
} |
| 3084 |
|
|
| 3095 |
{ |
{ |
| 3096 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM28); |
| 3097 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3098 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 3099 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3100 |
{ |
{ |
| 3101 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3102 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3103 |
} |
} |
| 3104 |
GETCHARINC(d, eptr); |
GETCHARINC(d, eptr); |
| 3105 |
if (d < 256) d = md->lcc[d]; |
if (d < 256) d = md->lcc[d]; |
| 3106 |
if (fc == d) RRETURN(MATCH_NOMATCH); |
if (fc == d) MRRETURN(MATCH_NOMATCH); |
| 3107 |
} |
} |
| 3108 |
} |
} |
| 3109 |
else |
else |
| 3114 |
{ |
{ |
| 3115 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM29); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM29); |
| 3116 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3117 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 3118 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3119 |
{ |
{ |
| 3120 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3121 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3122 |
} |
} |
| 3123 |
if (fc == md->lcc[*eptr++]) RRETURN(MATCH_NOMATCH); |
if (fc == md->lcc[*eptr++]) MRRETURN(MATCH_NOMATCH); |
| 3124 |
} |
} |
| 3125 |
} |
} |
| 3126 |
/* Control never gets here */ |
/* Control never gets here */ |
| 3182 |
} |
} |
| 3183 |
} |
} |
| 3184 |
|
|
| 3185 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3186 |
} |
} |
| 3187 |
/* Control never gets here */ |
/* Control never gets here */ |
| 3188 |
} |
} |
| 3201 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3202 |
{ |
{ |
| 3203 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3204 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3205 |
} |
} |
| 3206 |
GETCHARINC(d, eptr); |
GETCHARINC(d, eptr); |
| 3207 |
if (fc == d) RRETURN(MATCH_NOMATCH); |
if (fc == d) MRRETURN(MATCH_NOMATCH); |
| 3208 |
} |
} |
| 3209 |
} |
} |
| 3210 |
else |
else |
| 3216 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3217 |
{ |
{ |
| 3218 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3219 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3220 |
} |
} |
| 3221 |
if (fc == *eptr++) RRETURN(MATCH_NOMATCH); |
if (fc == *eptr++) MRRETURN(MATCH_NOMATCH); |
| 3222 |
} |
} |
| 3223 |
} |
} |
| 3224 |
|
|
| 3235 |
{ |
{ |
| 3236 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM32); |
| 3237 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3238 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 3239 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3240 |
{ |
{ |
| 3241 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3242 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3243 |
} |
} |
| 3244 |
GETCHARINC(d, eptr); |
GETCHARINC(d, eptr); |
| 3245 |
if (fc == d) RRETURN(MATCH_NOMATCH); |
if (fc == d) MRRETURN(MATCH_NOMATCH); |
| 3246 |
} |
} |
| 3247 |
} |
} |
| 3248 |
else |
else |
| 3253 |
{ |
{ |
| 3254 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM33); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM33); |
| 3255 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 3256 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 3257 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3258 |
{ |
{ |
| 3259 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3260 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3261 |
} |
} |
| 3262 |
if (fc == *eptr++) RRETURN(MATCH_NOMATCH); |
if (fc == *eptr++) MRRETURN(MATCH_NOMATCH); |
| 3263 |
} |
} |
| 3264 |
} |
} |
| 3265 |
/* Control never gets here */ |
/* Control never gets here */ |
| 3320 |
} |
} |
| 3321 |
} |
} |
| 3322 |
|
|
| 3323 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3324 |
} |
} |
| 3325 |
} |
} |
| 3326 |
/* Control never gets here */ |
/* Control never gets here */ |
| 3414 |
switch(prop_type) |
switch(prop_type) |
| 3415 |
{ |
{ |
| 3416 |
case PT_ANY: |
case PT_ANY: |
| 3417 |
if (prop_fail_result) RRETURN(MATCH_NOMATCH); |
if (prop_fail_result) MRRETURN(MATCH_NOMATCH); |
| 3418 |
for (i = 1; i <= min; i++) |
for (i = 1; i <= min; i++) |
| 3419 |
{ |
{ |
| 3420 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3421 |
{ |
{ |
| 3422 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3423 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3424 |
} |
} |
| 3425 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 3426 |
} |
} |
| 3432 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3433 |
{ |
{ |
| 3434 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3435 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3436 |
} |
} |
| 3437 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 3438 |
prop_chartype = UCD_CHARTYPE(c); |
prop_chartype = UCD_CHARTYPE(c); |
| 3439 |
if ((prop_chartype == ucp_Lu || |
if ((prop_chartype == ucp_Lu || |
| 3440 |
prop_chartype == ucp_Ll || |
prop_chartype == ucp_Ll || |
| 3441 |
prop_chartype == ucp_Lt) == prop_fail_result) |
prop_chartype == ucp_Lt) == prop_fail_result) |
| 3442 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3443 |
} |
} |
| 3444 |
break; |
break; |
| 3445 |
|
|
| 3449 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3450 |
{ |
{ |
| 3451 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3452 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3453 |
} |
} |
| 3454 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 3455 |
prop_category = UCD_CATEGORY(c); |
prop_category = UCD_CATEGORY(c); |
| 3456 |
if ((prop_category == prop_value) == prop_fail_result) |
if ((prop_category == prop_value) == prop_fail_result) |
| 3457 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3458 |
} |
} |
| 3459 |
break; |
break; |
| 3460 |
|
|
| 3464 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3465 |
{ |
{ |
| 3466 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3467 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3468 |
} |
} |
| 3469 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 3470 |
prop_chartype = UCD_CHARTYPE(c); |
prop_chartype = UCD_CHARTYPE(c); |
| 3471 |
if ((prop_chartype == prop_value) == prop_fail_result) |
if ((prop_chartype == prop_value) == prop_fail_result) |
| 3472 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3473 |
} |
} |
| 3474 |
break; |
break; |
| 3475 |
|
|
| 3479 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3480 |
{ |
{ |
| 3481 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3482 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3483 |
} |
} |
| 3484 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 3485 |
prop_script = UCD_SCRIPT(c); |
prop_script = UCD_SCRIPT(c); |
| 3486 |
if ((prop_script == prop_value) == prop_fail_result) |
if ((prop_script == prop_value) == prop_fail_result) |
| 3487 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3488 |
} |
} |
| 3489 |
break; |
break; |
| 3490 |
|
|
| 3503 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3504 |
{ |
{ |
| 3505 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3506 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3507 |
} |
} |
| 3508 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 3509 |
prop_category = UCD_CATEGORY(c); |
prop_category = UCD_CATEGORY(c); |
| 3510 |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
if (prop_category == ucp_M) MRRETURN(MATCH_NOMATCH); |
| 3511 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
| 3512 |
{ |
{ |
| 3513 |
int len = 1; |
int len = 1; |
| 3534 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3535 |
{ |
{ |
| 3536 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3537 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3538 |
} |
} |
| 3539 |
if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); |
if (IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); |
| 3540 |
eptr++; |
eptr++; |
| 3541 |
while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
| 3542 |
} |
} |
| 3548 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3549 |
{ |
{ |
| 3550 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3551 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3552 |
} |
} |
| 3553 |
eptr++; |
eptr++; |
| 3554 |
while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
while (eptr < md->end_subject && (*eptr & 0xc0) == 0x80) eptr++; |
| 3556 |
break; |
break; |
| 3557 |
|
|
| 3558 |
case OP_ANYBYTE: |
case OP_ANYBYTE: |
| 3559 |
if (eptr > md->end_subject - min) RRETURN(MATCH_NOMATCH); |
if (eptr > md->end_subject - min) MRRETURN(MATCH_NOMATCH); |
| 3560 |
eptr += min; |
eptr += min; |
| 3561 |
break; |
break; |
| 3562 |
|
|
| 3566 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3567 |
{ |
{ |
| 3568 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3569 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3570 |
} |
} |
| 3571 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3572 |
switch(c) |
switch(c) |
| 3573 |
{ |
{ |
| 3574 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 3575 |
case 0x000d: |
case 0x000d: |
| 3576 |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
| 3577 |
break; |
break; |
| 3584 |
case 0x0085: |
case 0x0085: |
| 3585 |
case 0x2028: |
case 0x2028: |
| 3586 |
case 0x2029: |
case 0x2029: |
| 3587 |
if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); |
if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); |
| 3588 |
break; |
break; |
| 3589 |
} |
} |
| 3590 |
} |
} |
| 3596 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3597 |
{ |
{ |
| 3598 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3599 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3600 |
} |
} |
| 3601 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3602 |
switch(c) |
switch(c) |
| 3621 |
case 0x202f: /* NARROW NO-BREAK SPACE */ |
case 0x202f: /* NARROW NO-BREAK SPACE */ |
| 3622 |
case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ |
case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ |
| 3623 |
case 0x3000: /* IDEOGRAPHIC SPACE */ |
case 0x3000: /* IDEOGRAPHIC SPACE */ |
| 3624 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3625 |
} |
} |
| 3626 |
} |
} |
| 3627 |
break; |
break; |
| 3632 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3633 |
{ |
{ |
| 3634 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3635 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3636 |
} |
} |
| 3637 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3638 |
switch(c) |
switch(c) |
| 3639 |
{ |
{ |
| 3640 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 3641 |
case 0x09: /* HT */ |
case 0x09: /* HT */ |
| 3642 |
case 0x20: /* SPACE */ |
case 0x20: /* SPACE */ |
| 3643 |
case 0xa0: /* NBSP */ |
case 0xa0: /* NBSP */ |
| 3668 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3669 |
{ |
{ |
| 3670 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3671 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3672 |
} |
} |
| 3673 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3674 |
switch(c) |
switch(c) |
| 3681 |
case 0x85: /* NEL */ |
case 0x85: /* NEL */ |
| 3682 |
case 0x2028: /* LINE SEPARATOR */ |
case 0x2028: /* LINE SEPARATOR */ |
| 3683 |
case 0x2029: /* PARAGRAPH SEPARATOR */ |
case 0x2029: /* PARAGRAPH SEPARATOR */ |
| 3684 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3685 |
} |
} |
| 3686 |
} |
} |
| 3687 |
break; |
break; |
| 3692 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3693 |
{ |
{ |
| 3694 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3695 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3696 |
} |
} |
| 3697 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3698 |
switch(c) |
switch(c) |
| 3699 |
{ |
{ |
| 3700 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 3701 |
case 0x0a: /* LF */ |
case 0x0a: /* LF */ |
| 3702 |
case 0x0b: /* VT */ |
case 0x0b: /* VT */ |
| 3703 |
case 0x0c: /* FF */ |
case 0x0c: /* FF */ |
| 3716 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3717 |
{ |
{ |
| 3718 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3719 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3720 |
} |
} |
| 3721 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 3722 |
if (c < 128 && (md->ctypes[c] & ctype_digit) != 0) |
if (c < 128 && (md->ctypes[c] & ctype_digit) != 0) |
| 3723 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3724 |
} |
} |
| 3725 |
break; |
break; |
| 3726 |
|
|
| 3730 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3731 |
{ |
{ |
| 3732 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3733 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3734 |
} |
} |
| 3735 |
if (*eptr >= 128 || (md->ctypes[*eptr++] & ctype_digit) == 0) |
if (*eptr >= 128 || (md->ctypes[*eptr++] & ctype_digit) == 0) |
| 3736 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3737 |
/* No need to skip more bytes - we know it's a 1-byte character */ |
/* No need to skip more bytes - we know it's a 1-byte character */ |
| 3738 |
} |
} |
| 3739 |
break; |
break; |
| 3744 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3745 |
{ |
{ |
| 3746 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3747 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3748 |
} |
} |
| 3749 |
if (*eptr < 128 && (md->ctypes[*eptr] & ctype_space) != 0) |
if (*eptr < 128 && (md->ctypes[*eptr] & ctype_space) != 0) |
| 3750 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3751 |
while (++eptr < md->end_subject && (*eptr & 0xc0) == 0x80); |
while (++eptr < md->end_subject && (*eptr & 0xc0) == 0x80); |
| 3752 |
} |
} |
| 3753 |
break; |
break; |
| 3758 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3759 |
{ |
{ |
| 3760 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3761 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3762 |
} |
} |
| 3763 |
if (*eptr >= 128 || (md->ctypes[*eptr++] & ctype_space) == 0) |
if (*eptr >= 128 || (md->ctypes[*eptr++] & ctype_space) == 0) |
| 3764 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3765 |
/* No need to skip more bytes - we know it's a 1-byte character */ |
/* No need to skip more bytes - we know it's a 1-byte character */ |
| 3766 |
} |
} |
| 3767 |
break; |
break; |
| 3769 |
case OP_NOT_WORDCHAR: |
case OP_NOT_WORDCHAR: |
| 3770 |
for (i = 1; i <= min; i++) |
for (i = 1; i <= min; i++) |
| 3771 |
{ |
{ |
| 3772 |
if (eptr >= md->end_subject || |
if (eptr >= md->end_subject) |
| 3773 |
(*eptr < 128 && (md->ctypes[*eptr] & ctype_word) != 0)) |
{ |
| 3774 |
RRETURN(MATCH_NOMATCH); |
SCHECK_PARTIAL(); |
| 3775 |
|
MRRETURN(MATCH_NOMATCH); |
| 3776 |
|
} |
| 3777 |
|
if (*eptr < 128 && (md->ctypes[*eptr] & ctype_word) != 0) |
| 3778 |
|
MRRETURN(MATCH_NOMATCH); |
| 3779 |
while (++eptr < md->end_subject && (*eptr & 0xc0) == 0x80); |
while (++eptr < md->end_subject && (*eptr & 0xc0) == 0x80); |
| 3780 |
} |
} |
| 3781 |
break; |
break; |
| 3786 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3787 |
{ |
{ |
| 3788 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3789 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3790 |
} |
} |
| 3791 |
if (*eptr >= 128 || (md->ctypes[*eptr++] & ctype_word) == 0) |
if (*eptr >= 128 || (md->ctypes[*eptr++] & ctype_word) == 0) |
| 3792 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3793 |
/* No need to skip more bytes - we know it's a 1-byte character */ |
/* No need to skip more bytes - we know it's a 1-byte character */ |
| 3794 |
} |
} |
| 3795 |
break; |
break; |
| 3812 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3813 |
{ |
{ |
| 3814 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3815 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3816 |
} |
} |
| 3817 |
if (IS_NEWLINE(eptr)) RRETURN(MATCH_NOMATCH); |
if (IS_NEWLINE(eptr)) MRRETURN(MATCH_NOMATCH); |
| 3818 |
eptr++; |
eptr++; |
| 3819 |
} |
} |
| 3820 |
break; |
break; |
| 3823 |
if (eptr > md->end_subject - min) |
if (eptr > md->end_subject - min) |
| 3824 |
{ |
{ |
| 3825 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3826 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3827 |
} |
} |
| 3828 |
eptr += min; |
eptr += min; |
| 3829 |
break; |
break; |
| 3832 |
if (eptr > md->end_subject - min) |
if (eptr > md->end_subject - min) |
| 3833 |
{ |
{ |
| 3834 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3835 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3836 |
} |
} |
| 3837 |
eptr += min; |
eptr += min; |
| 3838 |
break; |
break; |
| 3843 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3844 |
{ |
{ |
| 3845 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3846 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3847 |
} |
} |
| 3848 |
switch(*eptr++) |
switch(*eptr++) |
| 3849 |
{ |
{ |
| 3850 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 3851 |
case 0x000d: |
case 0x000d: |
| 3852 |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
| 3853 |
break; |
break; |
| 3857 |
case 0x000b: |
case 0x000b: |
| 3858 |
case 0x000c: |
case 0x000c: |
| 3859 |
case 0x0085: |
case 0x0085: |
| 3860 |
if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); |
if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); |
| 3861 |
break; |
break; |
| 3862 |
} |
} |
| 3863 |
} |
} |
| 3869 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3870 |
{ |
{ |
| 3871 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3872 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3873 |
} |
} |
| 3874 |
switch(*eptr++) |
switch(*eptr++) |
| 3875 |
{ |
{ |
| 3877 |
case 0x09: /* HT */ |
case 0x09: /* HT */ |
| 3878 |
case 0x20: /* SPACE */ |
case 0x20: /* SPACE */ |
| 3879 |
case 0xa0: /* NBSP */ |
case 0xa0: /* NBSP */ |
| 3880 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3881 |
} |
} |
| 3882 |
} |
} |
| 3883 |
break; |
break; |
| 3888 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3889 |
{ |
{ |
| 3890 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3891 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3892 |
} |
} |
| 3893 |
switch(*eptr++) |
switch(*eptr++) |
| 3894 |
{ |
{ |
| 3895 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 3896 |
case 0x09: /* HT */ |
case 0x09: /* HT */ |
| 3897 |
case 0x20: /* SPACE */ |
case 0x20: /* SPACE */ |
| 3898 |
case 0xa0: /* NBSP */ |
case 0xa0: /* NBSP */ |
| 3907 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3908 |
{ |
{ |
| 3909 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3910 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3911 |
} |
} |
| 3912 |
switch(*eptr++) |
switch(*eptr++) |
| 3913 |
{ |
{ |
| 3917 |
case 0x0c: /* FF */ |
case 0x0c: /* FF */ |
| 3918 |
case 0x0d: /* CR */ |
case 0x0d: /* CR */ |
| 3919 |
case 0x85: /* NEL */ |
case 0x85: /* NEL */ |
| 3920 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3921 |
} |
} |
| 3922 |
} |
} |
| 3923 |
break; |
break; |
| 3928 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3929 |
{ |
{ |
| 3930 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3931 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3932 |
} |
} |
| 3933 |
switch(*eptr++) |
switch(*eptr++) |
| 3934 |
{ |
{ |
| 3935 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 3936 |
case 0x0a: /* LF */ |
case 0x0a: /* LF */ |
| 3937 |
case 0x0b: /* VT */ |
case 0x0b: /* VT */ |
| 3938 |
case 0x0c: /* FF */ |
case 0x0c: /* FF */ |
| 3949 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3950 |
{ |
{ |
| 3951 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3952 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3953 |
} |
} |
| 3954 |
if ((md->ctypes[*eptr++] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[*eptr++] & ctype_digit) != 0) MRRETURN(MATCH_NOMATCH); |
| 3955 |
} |
} |
| 3956 |
break; |
break; |
| 3957 |
|
|
| 3961 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3962 |
{ |
{ |
| 3963 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3964 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3965 |
} |
} |
| 3966 |
if ((md->ctypes[*eptr++] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[*eptr++] & ctype_digit) == 0) MRRETURN(MATCH_NOMATCH); |
| 3967 |
} |
} |
| 3968 |
break; |
break; |
| 3969 |
|
|
| 3973 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3974 |
{ |
{ |
| 3975 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3976 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3977 |
} |
} |
| 3978 |
if ((md->ctypes[*eptr++] & ctype_space) != 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[*eptr++] & ctype_space) != 0) MRRETURN(MATCH_NOMATCH); |
| 3979 |
} |
} |
| 3980 |
break; |
break; |
| 3981 |
|
|
| 3985 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3986 |
{ |
{ |
| 3987 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 3988 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 3989 |
} |
} |
| 3990 |
if ((md->ctypes[*eptr++] & ctype_space) == 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[*eptr++] & ctype_space) == 0) MRRETURN(MATCH_NOMATCH); |
| 3991 |
} |
} |
| 3992 |
break; |
break; |
| 3993 |
|
|
| 3997 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 3998 |
{ |
{ |
| 3999 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4000 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4001 |
} |
} |
| 4002 |
if ((md->ctypes[*eptr++] & ctype_word) != 0) |
if ((md->ctypes[*eptr++] & ctype_word) != 0) |
| 4003 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4004 |
} |
} |
| 4005 |
break; |
break; |
| 4006 |
|
|
| 4010 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4011 |
{ |
{ |
| 4012 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4013 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4014 |
} |
} |
| 4015 |
if ((md->ctypes[*eptr++] & ctype_word) == 0) |
if ((md->ctypes[*eptr++] & ctype_word) == 0) |
| 4016 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4017 |
} |
} |
| 4018 |
break; |
break; |
| 4019 |
|
|
| 4042 |
{ |
{ |
| 4043 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM36); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM36); |
| 4044 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4045 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4046 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4047 |
{ |
{ |
| 4048 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4049 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4050 |
} |
} |
| 4051 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 4052 |
if (prop_fail_result) RRETURN(MATCH_NOMATCH); |
if (prop_fail_result) MRRETURN(MATCH_NOMATCH); |
| 4053 |
} |
} |
| 4054 |
/* Control never gets here */ |
/* Control never gets here */ |
| 4055 |
|
|
| 4058 |
{ |
{ |
| 4059 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM37); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM37); |
| 4060 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4061 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4062 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4063 |
{ |
{ |
| 4064 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4065 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4066 |
} |
} |
| 4067 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 4068 |
prop_chartype = UCD_CHARTYPE(c); |
prop_chartype = UCD_CHARTYPE(c); |
| 4069 |
if ((prop_chartype == ucp_Lu || |
if ((prop_chartype == ucp_Lu || |
| 4070 |
prop_chartype == ucp_Ll || |
prop_chartype == ucp_Ll || |
| 4071 |
prop_chartype == ucp_Lt) == prop_fail_result) |
prop_chartype == ucp_Lt) == prop_fail_result) |
| 4072 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4073 |
} |
} |
| 4074 |
/* Control never gets here */ |
/* Control never gets here */ |
| 4075 |
|
|
| 4078 |
{ |
{ |
| 4079 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM38); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM38); |
| 4080 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4081 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4082 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4083 |
{ |
{ |
| 4084 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4085 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4086 |
} |
} |
| 4087 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 4088 |
prop_category = UCD_CATEGORY(c); |
prop_category = UCD_CATEGORY(c); |
| 4089 |
if ((prop_category == prop_value) == prop_fail_result) |
if ((prop_category == prop_value) == prop_fail_result) |
| 4090 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4091 |
} |
} |
| 4092 |
/* Control never gets here */ |
/* Control never gets here */ |
| 4093 |
|
|
| 4096 |
{ |
{ |
| 4097 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM39); |
| 4098 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4099 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4100 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4101 |
{ |
{ |
| 4102 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4103 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4104 |
} |
} |
| 4105 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 4106 |
prop_chartype = UCD_CHARTYPE(c); |
prop_chartype = UCD_CHARTYPE(c); |
| 4107 |
if ((prop_chartype == prop_value) == prop_fail_result) |
if ((prop_chartype == prop_value) == prop_fail_result) |
| 4108 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4109 |
} |
} |
| 4110 |
/* Control never gets here */ |
/* Control never gets here */ |
| 4111 |
|
|
| 4114 |
{ |
{ |
| 4115 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM40); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM40); |
| 4116 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4117 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4118 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4119 |
{ |
{ |
| 4120 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4121 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4122 |
} |
} |
| 4123 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 4124 |
prop_script = UCD_SCRIPT(c); |
prop_script = UCD_SCRIPT(c); |
| 4125 |
if ((prop_script == prop_value) == prop_fail_result) |
if ((prop_script == prop_value) == prop_fail_result) |
| 4126 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4127 |
} |
} |
| 4128 |
/* Control never gets here */ |
/* Control never gets here */ |
| 4129 |
|
|
| 4141 |
{ |
{ |
| 4142 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM41); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM41); |
| 4143 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4144 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4145 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4146 |
{ |
{ |
| 4147 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4148 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4149 |
} |
} |
| 4150 |
GETCHARINCTEST(c, eptr); |
GETCHARINCTEST(c, eptr); |
| 4151 |
prop_category = UCD_CATEGORY(c); |
prop_category = UCD_CATEGORY(c); |
| 4152 |
if (prop_category == ucp_M) RRETURN(MATCH_NOMATCH); |
if (prop_category == ucp_M) MRRETURN(MATCH_NOMATCH); |
| 4153 |
while (eptr < md->end_subject) |
while (eptr < md->end_subject) |
| 4154 |
{ |
{ |
| 4155 |
int len = 1; |
int len = 1; |
| 4173 |
{ |
{ |
| 4174 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM42); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM42); |
| 4175 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4176 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4177 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4178 |
{ |
{ |
| 4179 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4180 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4181 |
} |
} |
| 4182 |
if (ctype == OP_ANY && IS_NEWLINE(eptr)) |
if (ctype == OP_ANY && IS_NEWLINE(eptr)) |
| 4183 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4184 |
GETCHARINC(c, eptr); |
GETCHARINC(c, eptr); |
| 4185 |
switch(ctype) |
switch(ctype) |
| 4186 |
{ |
{ |
| 4192 |
case OP_ANYNL: |
case OP_ANYNL: |
| 4193 |
switch(c) |
switch(c) |
| 4194 |
{ |
{ |
| 4195 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 4196 |
case 0x000d: |
case 0x000d: |
| 4197 |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
| 4198 |
break; |
break; |
| 4204 |
case 0x0085: |
case 0x0085: |
| 4205 |
case 0x2028: |
case 0x2028: |
| 4206 |
case 0x2029: |
case 0x2029: |
| 4207 |
if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); |
if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); |
| 4208 |
break; |
break; |
| 4209 |
} |
} |
| 4210 |
break; |
break; |
| 4232 |
case 0x202f: /* NARROW NO-BREAK SPACE */ |
case 0x202f: /* NARROW NO-BREAK SPACE */ |
| 4233 |
case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ |
case 0x205f: /* MEDIUM MATHEMATICAL SPACE */ |
| 4234 |
case 0x3000: /* IDEOGRAPHIC SPACE */ |
case 0x3000: /* IDEOGRAPHIC SPACE */ |
| 4235 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4236 |
} |
} |
| 4237 |
break; |
break; |
| 4238 |
|
|
| 4239 |
case OP_HSPACE: |
case OP_HSPACE: |
| 4240 |
switch(c) |
switch(c) |
| 4241 |
{ |
{ |
| 4242 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 4243 |
case 0x09: /* HT */ |
case 0x09: /* HT */ |
| 4244 |
case 0x20: /* SPACE */ |
case 0x20: /* SPACE */ |
| 4245 |
case 0xa0: /* NBSP */ |
case 0xa0: /* NBSP */ |
| 4274 |
case 0x85: /* NEL */ |
case 0x85: /* NEL */ |
| 4275 |
case 0x2028: /* LINE SEPARATOR */ |
case 0x2028: /* LINE SEPARATOR */ |
| 4276 |
case 0x2029: /* PARAGRAPH SEPARATOR */ |
case 0x2029: /* PARAGRAPH SEPARATOR */ |
| 4277 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4278 |
} |
} |
| 4279 |
break; |
break; |
| 4280 |
|
|
| 4281 |
case OP_VSPACE: |
case OP_VSPACE: |
| 4282 |
switch(c) |
switch(c) |
| 4283 |
{ |
{ |
| 4284 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 4285 |
case 0x0a: /* LF */ |
case 0x0a: /* LF */ |
| 4286 |
case 0x0b: /* VT */ |
case 0x0b: /* VT */ |
| 4287 |
case 0x0c: /* FF */ |
case 0x0c: /* FF */ |
| 4295 |
|
|
| 4296 |
case OP_NOT_DIGIT: |
case OP_NOT_DIGIT: |
| 4297 |
if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) |
if (c < 256 && (md->ctypes[c] & ctype_digit) != 0) |
| 4298 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4299 |
break; |
break; |
| 4300 |
|
|
| 4301 |
case OP_DIGIT: |
case OP_DIGIT: |
| 4302 |
if (c >= 256 || (md->ctypes[c] & ctype_digit) == 0) |
if (c >= 256 || (md->ctypes[c] & ctype_digit) == 0) |
| 4303 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4304 |
break; |
break; |
| 4305 |
|
|
| 4306 |
case OP_NOT_WHITESPACE: |
case OP_NOT_WHITESPACE: |
| 4307 |
if (c < 256 && (md->ctypes[c] & ctype_space) != 0) |
if (c < 256 && (md->ctypes[c] & ctype_space) != 0) |
| 4308 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4309 |
break; |
break; |
| 4310 |
|
|
| 4311 |
case OP_WHITESPACE: |
case OP_WHITESPACE: |
| 4312 |
if (c >= 256 || (md->ctypes[c] & ctype_space) == 0) |
if (c >= 256 || (md->ctypes[c] & ctype_space) == 0) |
| 4313 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4314 |
break; |
break; |
| 4315 |
|
|
| 4316 |
case OP_NOT_WORDCHAR: |
case OP_NOT_WORDCHAR: |
| 4317 |
if (c < 256 && (md->ctypes[c] & ctype_word) != 0) |
if (c < 256 && (md->ctypes[c] & ctype_word) != 0) |
| 4318 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4319 |
break; |
break; |
| 4320 |
|
|
| 4321 |
case OP_WORDCHAR: |
case OP_WORDCHAR: |
| 4322 |
if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) |
if (c >= 256 || (md->ctypes[c] & ctype_word) == 0) |
| 4323 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4324 |
break; |
break; |
| 4325 |
|
|
| 4326 |
default: |
default: |
| 4336 |
{ |
{ |
| 4337 |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM43); |
RMATCH(eptr, ecode, offset_top, md, ims, eptrb, 0, RM43); |
| 4338 |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
if (rrc != MATCH_NOMATCH) RRETURN(rrc); |
| 4339 |
if (fi >= max) RRETURN(MATCH_NOMATCH); |
if (fi >= max) MRRETURN(MATCH_NOMATCH); |
| 4340 |
if (eptr >= md->end_subject) |
if (eptr >= md->end_subject) |
| 4341 |
{ |
{ |
| 4342 |
SCHECK_PARTIAL(); |
SCHECK_PARTIAL(); |
| 4343 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4344 |
} |
} |
| 4345 |
if (ctype == OP_ANY && IS_NEWLINE(eptr)) |
if (ctype == OP_ANY && IS_NEWLINE(eptr)) |
| 4346 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4347 |
c = *eptr++; |
c = *eptr++; |
| 4348 |
switch(ctype) |
switch(ctype) |
| 4349 |
{ |
{ |
| 4355 |
case OP_ANYNL: |
case OP_ANYNL: |
| 4356 |
switch(c) |
switch(c) |
| 4357 |
{ |
{ |
| 4358 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 4359 |
case 0x000d: |
case 0x000d: |
| 4360 |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
if (eptr < md->end_subject && *eptr == 0x0a) eptr++; |
| 4361 |
break; |
break; |
| 4366 |
case 0x000b: |
case 0x000b: |
| 4367 |
case 0x000c: |
case 0x000c: |
| 4368 |
case 0x0085: |
case 0x0085: |
| 4369 |
if (md->bsr_anycrlf) RRETURN(MATCH_NOMATCH); |
if (md->bsr_anycrlf) MRRETURN(MATCH_NOMATCH); |
| 4370 |
break; |
break; |
| 4371 |
} |
} |
| 4372 |
break; |
break; |
| 4378 |
case 0x09: /* HT */ |
case 0x09: /* HT */ |
| 4379 |
case 0x20: /* SPACE */ |
case 0x20: /* SPACE */ |
| 4380 |
case 0xa0: /* NBSP */ |
case 0xa0: /* NBSP */ |
| 4381 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4382 |
} |
} |
| 4383 |
break; |
break; |
| 4384 |
|
|
| 4385 |
case OP_HSPACE: |
case OP_HSPACE: |
| 4386 |
switch(c) |
switch(c) |
| 4387 |
{ |
{ |
| 4388 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 4389 |
case 0x09: /* HT */ |
case 0x09: /* HT */ |
| 4390 |
case 0x20: /* SPACE */ |
case 0x20: /* SPACE */ |
| 4391 |
case 0xa0: /* NBSP */ |
case 0xa0: /* NBSP */ |
| 4402 |
case 0x0c: /* FF */ |
case 0x0c: /* FF */ |
| 4403 |
case 0x0d: /* CR */ |
case 0x0d: /* CR */ |
| 4404 |
case 0x85: /* NEL */ |
case 0x85: /* NEL */ |
| 4405 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 4406 |
} |
} |
| 4407 |
break; |
break; |
| 4408 |
|
|
| 4409 |
case OP_VSPACE: |
case OP_VSPACE: |
| 4410 |
switch(c) |
switch(c) |
| 4411 |
{ |
{ |
| 4412 |
default: RRETURN(MATCH_NOMATCH); |
default: MRRETURN(MATCH_NOMATCH); |
| 4413 |
case 0x0a: /* LF */ |
case 0x0a: /* LF */ |
| 4414 |
case 0x0b: /* VT */ |
case 0x0b: /* VT */ |
| 4415 |
case 0x0c: /* FF */ |
case 0x0c: /* FF */ |
| 4420 |
break; |
break; |
| 4421 |
|
|
| 4422 |
case OP_NOT_DIGIT: |
case OP_NOT_DIGIT: |
| 4423 |
if ((md->ctypes[c] & ctype_digit) != 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[c] & ctype_digit) != 0) MRRETURN(MATCH_NOMATCH); |
| 4424 |
break; |
break; |
| 4425 |
|
|
| 4426 |
case OP_DIGIT: |
case OP_DIGIT: |
| 4427 |
if ((md->ctypes[c] & ctype_digit) == 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[c] & ctype_digit) == 0) MRRETURN(MATCH_NOMATCH); |
| 4428 |
break; |
break; |
| 4429 |
|
|
| 4430 |
case OP_NOT_WHITESPACE: |
case OP_NOT_WHITESPACE: |
| 4431 |
if ((md->ctypes[c] & ctype_space) != 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[c] & ctype_space) != 0) MRRETURN(MATCH_NOMATCH); |
| 4432 |
break; |
break; |
| 4433 |
|
|
| 4434 |
case OP_WHITESPACE: |
case OP_WHITESPACE: |
| 4435 |
if ((md->ctypes[c] & ctype_space) == 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[c] & ctype_space) == 0) MRRETURN(MATCH_NOMATCH); |
| 4436 |
break; |
break; |
| 4437 |
|
|
| 4438 |
case OP_NOT_WORDCHAR: |
case OP_NOT_WORDCHAR: |
| 4439 |
if ((md->ctypes[c] & ctype_word) != 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[c] & ctype_word) != 0) MRRETURN(MATCH_NOMATCH); |
| 4440 |
break; |
break; |
| 4441 |
|
|
| 4442 |
case OP_WORDCHAR: |
case OP_WORDCHAR: |
| 4443 |
if ((md->ctypes[c] & ctype_word) == 0) RRETURN(MATCH_NOMATCH); |
if ((md->ctypes[c] & ctype_word) == 0) MRRETURN(MATCH_NOMATCH); |
| 4444 |
break; |
break; |
| 4445 |
|
|
| 4446 |
default: |
default: |
| 5100 |
|
|
| 5101 |
/* Get here if we can't make it match with any permitted repetitions */ |
/* Get here if we can't make it match with any permitted repetitions */ |
| 5102 |
|
|
| 5103 |
RRETURN(MATCH_NOMATCH); |
MRRETURN(MATCH_NOMATCH); |
| 5104 |
} |
} |
| 5105 |
/* Control never gets here */ |
/* Control never gets here */ |
| 5106 |
|
|
| 5351 |
md->partial = ((options & PCRE_PARTIAL_HARD) != 0)? 2 : |
md->partial = ((options & PCRE_PARTIAL_HARD) != 0)? 2 : |
| 5352 |
((options & PCRE_PARTIAL_SOFT) != 0)? 1 : 0; |
((options & PCRE_PARTIAL_SOFT) != 0)? 1 : 0; |
| 5353 |
md->hitend = FALSE; |
md->hitend = FALSE; |
| 5354 |
|
md->mark = NULL; /* In case never set */ |
| 5355 |
|
|
| 5356 |
md->recursive = NULL; /* No recursion at top level */ |
md->recursive = NULL; /* No recursion at top level */ |
| 5357 |
|
|
| 5651 |
bytes to avoid spending too much time in this optimization. */ |
bytes to avoid spending too much time in this optimization. */ |
| 5652 |
|
|
| 5653 |
if (study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0 && |
if (study != NULL && (study->flags & PCRE_STUDY_MINLEN) != 0 && |
| 5654 |
end_subject - start_match < study->minlength) |
(pcre_uint32)(end_subject - start_match) < study->minlength) |
| 5655 |
{ |
{ |
| 5656 |
rc = MATCH_NOMATCH; |
rc = MATCH_NOMATCH; |
| 5657 |
break; |
break; |
| 5714 |
} |
} |
| 5715 |
} |
} |
| 5716 |
|
|
| 5717 |
#ifdef DEBUG /* Sigh. Some compilers never learn. */ |
#ifdef PCRE_DEBUG /* Sigh. Some compilers never learn. */ |
| 5718 |
printf(">>>> Match against: "); |
printf(">>>> Match against: "); |
| 5719 |
pchars(start_match, end_subject - start_match, TRUE, md); |
pchars(start_match, end_subject - start_match, TRUE, md); |
| 5720 |
printf("\n"); |
printf("\n"); |
| 5722 |
|
|
| 5723 |
/* OK, we can now run the match. If "hitend" is set afterwards, remember the |
/* OK, we can now run the match. If "hitend" is set afterwards, remember the |
| 5724 |
first starting point for which a partial match was found. */ |
first starting point for which a partial match was found. */ |
| 5725 |
|
|
| 5726 |
md->start_match_ptr = start_match; |
md->start_match_ptr = start_match; |
| 5727 |
md->start_used_ptr = start_match; |
md->start_used_ptr = start_match; |
| 5728 |
md->match_call_count = 0; |
md->match_call_count = 0; |
| 5729 |
rc = match(start_match, md->start_code, start_match, 2, md, ims, NULL, 0, 0); |
rc = match(start_match, md->start_code, start_match, NULL, 2, md, ims, NULL, |
| 5730 |
|
0, 0); |
| 5731 |
if (md->hitend && start_partial == NULL) start_partial = md->start_used_ptr; |
if (md->hitend && start_partial == NULL) start_partial = md->start_used_ptr; |
| 5732 |
|
|
| 5733 |
switch(rc) |
switch(rc) |
| 5734 |
{ |
{ |
| 5735 |
/* NOMATCH and PRUNE advance by one character. THEN at this level acts |
/* NOMATCH and PRUNE advance by one character. If MATCH_SKIP_ARG reaches |
| 5736 |
exactly like PRUNE. */ |
this level it means that a MARK that matched the SKIP's arg was not found. |
| 5737 |
|
We treat this as NOMATCH. THEN at this level acts exactly like PRUNE. */ |
| 5738 |
|
|
| 5739 |
case MATCH_NOMATCH: |
case MATCH_NOMATCH: |
| 5740 |
case MATCH_PRUNE: |
case MATCH_PRUNE: |
| 5741 |
|
case MATCH_SKIP_ARG: |
| 5742 |
case MATCH_THEN: |
case MATCH_THEN: |
| 5743 |
new_start_match = start_match + 1; |
new_start_match = start_match + 1; |
| 5744 |
#ifdef SUPPORT_UTF8 |
#ifdef SUPPORT_UTF8 |
| 5799 |
md->nllen == 2)) |
md->nllen == 2)) |
| 5800 |
start_match++; |
start_match++; |
| 5801 |
|
|
| 5802 |
} /* End of for(;;) "bumpalong" loop */ |
md->mark = NULL; /* Reset for start of next match attempt */ |
| 5803 |
|
} /* End of for(;;) "bumpalong" loop */ |
| 5804 |
|
|
| 5805 |
/* ==========================================================================*/ |
/* ==========================================================================*/ |
| 5806 |
|
|
| 5824 |
|
|
| 5825 |
ENDLOOP: |
ENDLOOP: |
| 5826 |
|
|
| 5827 |
if (rc == MATCH_MATCH) |
if (rc == MATCH_MATCH || rc == MATCH_ACCEPT) |
| 5828 |
{ |
{ |
| 5829 |
if (using_temporary_offsets) |
if (using_temporary_offsets) |
| 5830 |
{ |
{ |
| 5855 |
} |
} |
| 5856 |
|
|
| 5857 |
DPRINTF((">>>> returning %d\n", rc)); |
DPRINTF((">>>> returning %d\n", rc)); |
| 5858 |
return rc; |
goto RETURN_MARK; |
| 5859 |
} |
} |
| 5860 |
|
|
| 5861 |
/* Control gets here if there has been an error, or if the overall match |
/* Control gets here if there has been an error, or if the overall match |
| 5866 |
DPRINTF(("Freeing temporary memory\n")); |
DPRINTF(("Freeing temporary memory\n")); |
| 5867 |
(pcre_free)(md->offset_vector); |
(pcre_free)(md->offset_vector); |
| 5868 |
} |
} |
| 5869 |
|
|
| 5870 |
|
/* For anything other than nomatch or partial match, just return the code. */ |
| 5871 |
|
|
| 5872 |
if (rc != MATCH_NOMATCH && rc != PCRE_ERROR_PARTIAL) |
if (rc != MATCH_NOMATCH && rc != PCRE_ERROR_PARTIAL) |
| 5873 |
{ |
{ |
| 5874 |
DPRINTF((">>>> error: returning %d\n", rc)); |
DPRINTF((">>>> error: returning %d\n", rc)); |
| 5875 |
return rc; |
return rc; |
| 5876 |
} |
} |
| 5877 |
else if (start_partial != NULL) |
|
| 5878 |
|
/* Handle partial matches - disable any mark data */ |
| 5879 |
|
|
| 5880 |
|
if (start_partial != NULL) |
| 5881 |
{ |
{ |
| 5882 |
DPRINTF((">>>> returning PCRE_ERROR_PARTIAL\n")); |
DPRINTF((">>>> returning PCRE_ERROR_PARTIAL\n")); |
| 5883 |
|
md->mark = NULL; |
| 5884 |
if (offsetcount > 1) |
if (offsetcount > 1) |
| 5885 |
{ |
{ |
| 5886 |
offsets[0] = start_partial - (USPTR)subject; |
offsets[0] = start_partial - (USPTR)subject; |
| 5887 |
offsets[1] = end_subject - (USPTR)subject; |
offsets[1] = end_subject - (USPTR)subject; |
| 5888 |
} |
} |
| 5889 |
return PCRE_ERROR_PARTIAL; |
rc = PCRE_ERROR_PARTIAL; |
| 5890 |
} |
} |
| 5891 |
|
|
| 5892 |
|
/* This is the classic nomatch case */ |
| 5893 |
|
|
| 5894 |
else |
else |
| 5895 |
{ |
{ |
| 5896 |
DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n")); |
DPRINTF((">>>> returning PCRE_ERROR_NOMATCH\n")); |
| 5897 |
return PCRE_ERROR_NOMATCH; |
rc = PCRE_ERROR_NOMATCH; |
| 5898 |
} |
} |
| 5899 |
|
|
| 5900 |
|
/* Return the MARK data if it has been requested. */ |
| 5901 |
|
|
| 5902 |
|
RETURN_MARK: |
| 5903 |
|
|
| 5904 |
|
if (extra_data != NULL && (extra_data->flags & PCRE_EXTRA_MARK) != 0) |
| 5905 |
|
*(extra_data->mark) = (unsigned char *)(md->mark); |
| 5906 |
|
return rc; |
| 5907 |
} |
} |
| 5908 |
|
|
| 5909 |
/* End of pcre_exec.c */ |
/* End of pcre_exec.c */ |