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

ruby-changes:37364

From: usa <ko1@a...>
Date: Fri, 30 Jan 2015 16:13:28 +0900 (JST)
Subject: [ruby-changes:37364] usa:r49445 (ruby_2_0_0): merge revision(s) 49223: [Backport #10732]

usa	2015-01-30 16:13:13 +0900 (Fri, 30 Jan 2015)

  New Revision: 49445

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

  Log:
    merge revision(s) 49223: [Backport #10732]
    
    * lib/rdoc/text.rb (expand_tabs): get rid of infinite loop with
      CR.  should check if substitution occurred too.
      [ruby-dev:48813] [Bug #10732]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/lib/rdoc/text.rb
    branches/ruby_2_0_0/test/rdoc/test_rdoc_text.rb
    branches/ruby_2_0_0/version.h
Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 49444)
+++ ruby_2_0_0/ChangeLog	(revision 49445)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Fri Jan 30 16:11:47 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* lib/rdoc/text.rb (expand_tabs): get rid of infinite loop with
+	  CR.  should check if substitution occurred too.
+	  [ruby-dev:48813] [Bug #10732]
+
 Fri Jan 30 16:00:35 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/mkmf.rb (install_dirs): revert DESTDIR prefix by r39841, since
Index: ruby_2_0_0/lib/rdoc/text.rb
===================================================================
--- ruby_2_0_0/lib/rdoc/text.rb	(revision 49444)
+++ ruby_2_0_0/lib/rdoc/text.rb	(revision 49445)
@@ -68,11 +68,11 @@ module RDoc::Text https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/lib/rdoc/text.rb#L68
     expanded = []
 
     text.each_line do |line|
-      line.gsub!(/^((?:.{8})*?)([^\t\r\n]{0,7})\t/) do
+      nil while line.gsub!(/(?:\G|\r)((?:.{8})*?)([^\t\r\n]{0,7})\t/) do
         r = "#{$1}#{$2}#{' ' * (8 - $2.size)}"
         r.force_encoding text.encoding if Object.const_defined? :Encoding
         r
-      end until line !~ /\t/
+      end
 
       expanded << line
     end
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 49444)
+++ ruby_2_0_0/version.h	(revision 49445)
@@ -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 "2015-01-30"
-#define RUBY_PATCHLEVEL 625
+#define RUBY_PATCHLEVEL 626
 
 #define RUBY_RELEASE_YEAR 2015
 #define RUBY_RELEASE_MONTH 1
Index: ruby_2_0_0/test/rdoc/test_rdoc_text.rb
===================================================================
--- ruby_2_0_0/test/rdoc/test_rdoc_text.rb	(revision 49444)
+++ ruby_2_0_0/test/rdoc/test_rdoc_text.rb	(revision 49445)
@@ -63,6 +63,9 @@ class TestRDocText < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/rdoc/test_rdoc_text.rb#L63
 
     assert_equal('.               .',
                  expand_tabs(".\t\t."), 'dot tab tab dot')
+
+    assert_equal('a       a',
+                 Timeout.timeout(1) {expand_tabs("\ra\ta")}, "carriage return")
   end
 
   def test_expand_tabs_encoding

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r49223


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

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