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

ruby-changes:21387

From: kosaki <ko1@a...>
Date: Sat, 8 Oct 2011 20:32:18 +0900 (JST)
Subject: [ruby-changes:21387] kosaki:r33436 (ruby_1_9_3): merge revision(s) 33363:

kosaki	2011-10-08 20:32:06 +0900 (Sat, 08 Oct 2011)

  New Revision: 33436

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

  Log:
    merge revision(s) 33363:
    
    * array.c (ary_join_1): should not copy the encoding of non-string
      element after string element.  [ruby-core:39776] [Bug #5379]

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/array.c
    branches/ruby_1_9_3/test/ruby/test_array.rb

Index: ruby_1_9_3/array.c
===================================================================
--- ruby_1_9_3/array.c	(revision 33435)
+++ ruby_1_9_3/array.c	(revision 33436)
@@ -1644,6 +1644,7 @@
 	  case T_STRING:
 	  str_join:
 	    rb_str_buf_append(result, val);
+	    *first = FALSE;
 	    break;
 	  case T_ARRAY:
 	    obj = val;
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 33435)
+++ ruby_1_9_3/ChangeLog	(revision 33436)
@@ -1,3 +1,8 @@
+Sat Oct  8 07:31:42 2011  Nobuyoshi Nakada  <nobu@r...>
+
+	* array.c (ary_join_1): should not copy the encoding of non-string
+	  element after string element.  [ruby-core:39776] [Bug #5379]
+
 Sat Oct  8 06:51:46 2011  Eric Hodel  <drbrain@s...>
 
 	* lib/rubygems:  Update to RubyGems 1.8.11.  Move Deprecate into the
Index: ruby_1_9_3/test/ruby/test_array.rb
===================================================================
--- ruby_1_9_3/test/ruby/test_array.rb	(revision 33435)
+++ ruby_1_9_3/test/ruby/test_array.rb	(revision 33436)
@@ -926,6 +926,8 @@
     assert_equal(Encoding::US_ASCII, [1, [u]].join.encoding)
     assert_equal(Encoding::UTF_8, [u, [e]].join.encoding)
     assert_equal(Encoding::UTF_8, [u, [1]].join.encoding)
+    bug5379 = '[ruby-core:39776]'
+    assert_equal(Encoding::UTF_8, [[], u, nil].join.encoding, bug5379)
   ensure
     $, = nil
   end

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

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