647 |
/* ========================================================================== */ |
/* ========================================================================== */ |
648 |
/* Reached a closing bracket. If not at the end of the pattern, carry |
/* Reached a closing bracket. If not at the end of the pattern, carry |
649 |
on with the next opcode. Otherwise, unless we have an empty string and |
on with the next opcode. Otherwise, unless we have an empty string and |
650 |
PCRE_NOTEMPTY is set, save the match data, shifting up all previous |
PCRE_NOTEMPTY is set, or PCRE_NOTEMPTY_ATSTART is set and we are at the |
651 |
|
start of the subject, save the match data, shifting up all previous |
652 |
matches so we always have the longest first. */ |
matches so we always have the longest first. */ |
653 |
|
|
654 |
case OP_KET: |
case OP_KET: |
665 |
else |
else |
666 |
{ |
{ |
667 |
reached_end++; /* Count branches that reach the end */ |
reached_end++; /* Count branches that reach the end */ |
668 |
if (ptr > current_subject || (md->moptions & PCRE_NOTEMPTY) == 0) |
if (ptr > current_subject || |
669 |
|
((md->moptions & PCRE_NOTEMPTY) == 0 && |
670 |
|
((md->moptions & PCRE_NOTEMPTY_ATSTART) == 0 || |
671 |
|
current_subject > start_subject + md->start_offset))) |
672 |
{ |
{ |
673 |
if (match_count < 0) match_count = (offsetcount >= 2)? 1 : 0; |
if (match_count < 0) match_count = (offsetcount >= 2)? 1 : 0; |
674 |
else if (match_count > 0 && ++match_count * 2 >= offsetcount) |
else if (match_count > 0 && ++match_count * 2 >= offsetcount) |
2685 |
re->name_table_offset + re->name_count * re->name_entry_size; |
re->name_table_offset + re->name_count * re->name_entry_size; |
2686 |
md->start_subject = (const unsigned char *)subject; |
md->start_subject = (const unsigned char *)subject; |
2687 |
md->end_subject = end_subject; |
md->end_subject = end_subject; |
2688 |
|
md->start_offset = start_offset; |
2689 |
md->moptions = options; |
md->moptions = options; |
2690 |
md->poptions = re->options; |
md->poptions = re->options; |
2691 |
|
|