ruby-changes:34518
From: nagachika <ko1@a...>
Date: Sat, 28 Jun 2014 16:42:35 +0900 (JST)
Subject: [ruby-changes:34518] nagachika:r46599 (ruby_2_1): merge revision(s) r46243, r46244: [Backport #9882] [Backport #9883]
nagachika 2014-06-28 16:42:19 +0900 (Sat, 28 Jun 2014) New Revision: 46599 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46599 Log: merge revision(s) r46243,r46244: [Backport #9882] [Backport #9883] * string.c (rb_str_substr): need to reset code range for shared string too, not only copied string. [ruby-core:62842] [Bug #9882] Modified directories: branches/ruby_2_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/string.c branches/ruby_2_1/test/ruby/test_string.rb branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 46598) +++ ruby_2_1/ChangeLog (revision 46599) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Sat Jun 28 16:35:51 2014 Nobuyoshi Nakada <nobu@r...> + + * string.c (rb_str_substr): need to reset code range for shared + string too, not only copied string. + [ruby-core:62842] [Bug #9882] + Sat Jun 28 14:37:17 2014 Nobuyoshi Nakada <nobu@r...> * parse.y (local_tbl_gen): remove local variables duplicated with Index: ruby_2_1/string.c =================================================================== --- ruby_2_1/string.c (revision 46598) +++ ruby_2_1/string.c (revision 46599) @@ -1956,10 +1956,10 @@ rb_str_substr(VALUE str, long beg, long https://github.com/ruby/ruby/blob/trunk/ruby_2_1/string.c#L1956 } else { str2 = rb_str_new5(str, p, len); - rb_enc_cr_str_copy_for_substr(str2, str); OBJ_INFECT(str2, str); RB_GC_GUARD(str); } + rb_enc_cr_str_copy_for_substr(str2, str); return str2; } Index: ruby_2_1/version.h =================================================================== --- ruby_2_1/version.h (revision 46598) +++ ruby_2_1/version.h (revision 46599) @@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.2" #define RUBY_RELEASE_DATE "2014-06-28" -#define RUBY_PATCHLEVEL 143 +#define RUBY_PATCHLEVEL 144 #define RUBY_RELEASE_YEAR 2014 #define RUBY_RELEASE_MONTH 6 Index: ruby_2_1/test/ruby/test_string.rb =================================================================== --- ruby_2_1/test/ruby/test_string.rb (revision 46598) +++ ruby_2_1/test/ruby/test_string.rb (revision 46599) @@ -1179,6 +1179,11 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/ruby/test_string.rb#L1179 assert_equal(S("Bar"), S("FooBar").slice(S("Bar"))) assert_nil(S("FooBar").slice(S("xyzzy"))) assert_nil(S("FooBar").slice(S("plugh"))) + + bug9882 = '[ruby-core:62842] [Bug #9882]' + substr = S("\u{30c6 30b9 30c8 2019}#{bug9882}").slice(4..-1) + assert_equal(S(bug9882).hash, substr.hash, bug9882) + assert_predicate(substr, :ascii_only?, bug9882) end def test_slice! Property changes on: ruby_2_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r46243-46244 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/