ruby-changes:16725
From: mame <ko1@a...>
Date: Thu, 22 Jul 2010 22:38:20 +0900 (JST)
Subject: [ruby-changes:16725] Ruby:r28721 (ruby_1_9_2): merge revision(s) 28648:
mame 2010-07-22 22:37:07 +0900 (Thu, 22 Jul 2010) New Revision: 28721 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=28721 Log: merge revision(s) 28648: * 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] Modified files: branches/ruby_1_9_2/ChangeLog branches/ruby_1_9_2/regexec.c branches/ruby_1_9_2/test/ruby/test_regexp.rb Index: ruby_1_9_2/ChangeLog =================================================================== --- ruby_1_9_2/ChangeLog (revision 28720) +++ ruby_1_9_2/ChangeLog (revision 28721) @@ -1,3 +1,10 @@ +Thu Jul 22 22:14:59 2010 NARUSE, Yui <naruse@r...> + + * 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 22 22:13:48 2010 Yusuke Endoh <mame@t...> * thread_pthread.c (get_stack): fix memory leak; pthread_attr_destory Index: ruby_1_9_2/regexec.c =================================================================== --- ruby_1_9_2/regexec.c (revision 28720) +++ ruby_1_9_2/regexec.c (revision 28721) @@ -3636,11 +3636,6 @@ MATCH_AND_RETURN_CHECK(orig_range); prev = s; 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); goto mismatch; } Index: ruby_1_9_2/test/ruby/test_regexp.rb =================================================================== --- ruby_1_9_2/test/ruby/test_regexp.rb (revision 28720) +++ ruby_1_9_2/test/ruby/test_regexp.rb (revision 28721) @@ -11,6 +11,11 @@ $VERBOSE = @verbose end + def test_ruby_dev_999 + assert_match(/(?<=a).*b/, "aab") + assert_match(/(?<=\u3042).*b/, "\u3042ab") + end + def test_ruby_core_27247 assert_match(/(a){2}z/, "aaz") end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/