Fix for issue #2188.

[SVN r48185]
This commit is contained in:
John Maddock
2008-08-17 11:15:07 +00:00
parent 3a15c301db
commit 1012d28c32
2 changed files with 6 additions and 1 deletions

View File

@ -477,7 +477,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_rep()
take_second = can_start(*position, rep->_map, (unsigned char)mask_skip); take_second = can_start(*position, rep->_map, (unsigned char)mask_skip);
} }
if(take_first || (next_count->get_id() != rep->id)) if((m_backup_state->id != saved_state_repeater_count)
|| (static_cast<saved_repeater<BidiIterator>*>(m_backup_state)->count.get_id() != rep->id)
|| (next_count->get_id() != rep->id))
{ {
// we're moving to a different repeat from the last // we're moving to a different repeat from the last
// one, so set up a counter object: // one, so set up a counter object:

View File

@ -377,6 +377,9 @@ void test_tricky_cases3()
TEST_REGEX_SEARCH("(?:\\d{9}.*){2}", perl, "123456789dfsdfsdfsfsdfds123456789b", match_default, make_array(0, 34, -2, -2)); TEST_REGEX_SEARCH("(?:\\d{9}.*){2}", perl, "123456789dfsdfsdfsfsdfds123456789b", match_default, make_array(0, 34, -2, -2));
TEST_REGEX_SEARCH("(?:\\d{9}.*){2}", perl, "123456789dfsdfsdfsfsdfds12345678", match_default, make_array(-2, -2)); TEST_REGEX_SEARCH("(?:\\d{9}.*){2}", perl, "123456789dfsdfsdfsfsdfds12345678", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("(?:\\d{9}.*){2}", perl, "123456789dfsdfsdfsfsdfds", match_default, make_array(-2, -2)); TEST_REGEX_SEARCH("(?:\\d{9}.*){2}", perl, "123456789dfsdfsdfsfsdfds", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])(\\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])){3}$", perl, "1.2.03", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])(\\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])){3,4}$", perl, "1.2.03", match_default, make_array(-2, -2));
TEST_REGEX_SEARCH("^(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])(\\.(25[0-5]|2[0-4][0-9]|[0-1]?[0-9]?[0-9])){3,4}?$", perl, "1.2.03", match_default, make_array(-2, -2));
// //