[前][次][番号順一覧][スレッド一覧]

ruby-changes:34503

From: usa <ko1@a...>
Date: Fri, 27 Jun 2014 17:58:19 +0900 (JST)
Subject: [ruby-changes:34503] usa:r46584 (ruby_2_0_0): merge revision(s) 46243, 46244: [Backport #9882] [Backport #9883]

usa	2014-06-27 17:58:05 +0900 (Fri, 27 Jun 2014)

  New Revision: 46584

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46584

  Log:
    merge revision(s) 46243,46244: [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_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/string.c
    branches/ruby_2_0_0/test/ruby/test_string.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 46583)
+++ ruby_2_0_0/ChangeLog	(revision 46584)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Fri Jun 27 17:57:16 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]
+
 Fri Jun 27 17:54:09 2014  Rei Odaira  <Rei.Odaira@g...>
 
 	* signal.c (ruby_signal): should return either `old.sa_sigaction`
Index: ruby_2_0_0/string.c
===================================================================
--- ruby_2_0_0/string.c	(revision 46583)
+++ ruby_2_0_0/string.c	(revision 46584)
@@ -1786,10 +1786,10 @@ rb_str_substr(VALUE str, long beg, long https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/string.c#L1786
     }
     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_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 46583)
+++ ruby_2_0_0/version.h	(revision 46584)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
 #define RUBY_RELEASE_DATE "2014-06-27"
-#define RUBY_PATCHLEVEL 508
+#define RUBY_PATCHLEVEL 509
 
 #define RUBY_RELEASE_YEAR 2014
 #define RUBY_RELEASE_MONTH 6
Index: ruby_2_0_0/test/ruby/test_string.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_string.rb	(revision 46583)
+++ ruby_2_0_0/test/ruby/test_string.rb	(revision 46584)
@@ -1190,6 +1190,11 @@ class TestString < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_string.rb#L1190
     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_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r46243-46244


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]