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

ruby-changes:37217

From: naruse <ko1@a...>
Date: Sat, 17 Jan 2015 16:47:41 +0900 (JST)
Subject: [ruby-changes:37217] naruse:r49298 (ruby_2_2): merge revision(s) 49201, 49203: [Backport #10727]

naruse	2015-01-17 16:47:29 +0900 (Sat, 17 Jan 2015)

  New Revision: 49298

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

  Log:
    merge revision(s) 49201,49203: [Backport #10727]
    
    * eval_error.c (error_print): pos and len parameters of rb_str_substr()
      are counted by characters, not bytes.  use rb_str_subseq() instead.
      [Bug #10727] [ruby-core:67473]

  Modified directories:
    branches/ruby_2_2/
  Modified files:
    branches/ruby_2_2/ChangeLog
    branches/ruby_2_2/eval_error.c
    branches/ruby_2_2/test/ruby/test_exception.rb
    branches/ruby_2_2/version.h
Index: ruby_2_2/ChangeLog
===================================================================
--- ruby_2_2/ChangeLog	(revision 49297)
+++ ruby_2_2/ChangeLog	(revision 49298)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/ChangeLog#L1
+Sat Jan 17 16:47:20 2015  NAKAMURA Usaku  <usa@r...>
+
+	* eval_error.c (error_print): pos and len parameters of rb_str_substr()
+	  are counted by characters, not bytes.  use rb_str_subseq() instead.
+	  [Bug #10727] [ruby-core:67473]
+
 Sat Jan 17 16:35:59 2015  Seiei Higa  <hanachin@g...>
 
 	* vm_method.c (rb_export_method): bail out if the original method
Index: ruby_2_2/eval_error.c
===================================================================
--- ruby_2_2/eval_error.c	(revision 49297)
+++ ruby_2_2/eval_error.c	(revision 49298)
@@ -169,7 +169,7 @@ error_print(void) https://github.com/ruby/ruby/blob/trunk/ruby_2_2/eval_error.c#L169
 		warn_print(")\n");
 	    }
 	    if (tail) {
-		warn_print_str(rb_str_substr(e, tail - einfo, elen - len - 1));
+		warn_print_str(rb_str_subseq(e, tail - einfo, elen - len - 1));
 	    }
 	    if (tail ? einfo[elen-1] != '\n' : !epath) warn_print2("\n", 1);
 	}
Index: ruby_2_2/version.h
===================================================================
--- ruby_2_2/version.h	(revision 49297)
+++ ruby_2_2/version.h	(revision 49298)
@@ -1,6 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_2/version.h#L1
 #define RUBY_VERSION "2.2.0"
 #define RUBY_RELEASE_DATE "2015-01-17"
-#define RUBY_PATCHLEVEL 20
+#define RUBY_PATCHLEVEL 21
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 1
Index: ruby_2_2/test/ruby/test_exception.rb
===================================================================
--- ruby_2_2/test/ruby/test_exception.rb	(revision 49297)
+++ ruby_2_2/test/ruby/test_exception.rb	(revision 49298)
@@ -686,4 +686,16 @@ $stderr = $stdout; raise "\x82\xa0"') do https://github.com/ruby/ruby/blob/trunk/ruby_2_2/test/ruby/test_exception.rb#L686
       assert_match /\u3042/, err
     end
   end
+
+  def test_multibyte_and_newline
+    bug10727 = '[ruby-core:67473] [Bug #10727]'
+    assert_in_out_err([], <<-'end;', [], /\u{306b 307b 3093 3054} \(E\)\n\u{6539 884c}/, bug10727, encoding: "UTF-8")
+      class E < StandardError
+        def initialize
+          super("\u{306b 307b 3093 3054}\n\u{6539 884c}")
+        end
+      end
+      raise E
+    end;
+  end
 end

Property changes on: ruby_2_2
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r49201,49203


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

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