* regexec.c (onig_search): don't skip non-ANYCHARs when
.* fails to match. This causes to fail matching ANYCHAR_STAR with LOOK_BEHIND. This fix is workaround and disable the optimization. [ruby-dev:41851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28648 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1df8d6dbc3
commit
b4608406f1
@ -1,3 +1,10 @@
|
|||||||
|
Thu Jul 15 15:47:32 2010 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* regexec.c (onig_search): don't skip non-ANYCHARs when
|
||||||
|
.* fails to match. This causes to fail matching
|
||||||
|
ANYCHAR_STAR with LOOK_BEHIND. This fix is workaround
|
||||||
|
and disable the optimization. [ruby-dev:41851]
|
||||||
|
|
||||||
Thu Jul 15 06:11:29 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
Thu Jul 15 06:11:29 2010 Aaron Patterson <aaron@tenderlovemaking.com>
|
||||||
|
|
||||||
* lib/rdoc/markup/attribute_manager.rb: fixing ri output when special
|
* lib/rdoc/markup/attribute_manager.rb: fixing ri output when special
|
||||||
|
@ -3636,11 +3636,6 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
|
|||||||
MATCH_AND_RETURN_CHECK(orig_range);
|
MATCH_AND_RETURN_CHECK(orig_range);
|
||||||
prev = s;
|
prev = s;
|
||||||
s += enclen(reg->enc, s, end);
|
s += enclen(reg->enc, s, end);
|
||||||
|
|
||||||
while (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end) && s < range) {
|
|
||||||
prev = s;
|
|
||||||
s += enclen(reg->enc, s, end);
|
|
||||||
}
|
|
||||||
} while (s < range);
|
} while (s < range);
|
||||||
goto mismatch;
|
goto mismatch;
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,11 @@ class TestRegexp < Test::Unit::TestCase
|
|||||||
$VERBOSE = @verbose
|
$VERBOSE = @verbose
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_ruby_dev_999
|
||||||
|
assert_match(/(?<=a).*b/, "aab")
|
||||||
|
assert_match(/(?<=\u3042).*b/, "\u3042ab")
|
||||||
|
end
|
||||||
|
|
||||||
def test_ruby_core_27247
|
def test_ruby_core_27247
|
||||||
assert_match(/(a){2}z/, "aaz")
|
assert_match(/(a){2}z/, "aaz")
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user