ruby-changes:37548
From: nagachika <ko1@a...>
Date: Wed, 18 Feb 2015 00:18:55 +0900 (JST)
Subject: [ruby-changes:37548] nagachika:r49629 (ruby_2_1): merge revision(s) r49223: [Backport #10732]
nagachika 2015-02-18 00:18:40 +0900 (Wed, 18 Feb 2015) New Revision: 49629 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49629 Log: merge revision(s) r49223: [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_1/ Modified files: branches/ruby_2_1/ChangeLog branches/ruby_2_1/lib/rdoc/text.rb branches/ruby_2_1/test/rdoc/test_rdoc_text.rb branches/ruby_2_1/version.h Index: ruby_2_1/ChangeLog =================================================================== --- ruby_2_1/ChangeLog (revision 49628) +++ ruby_2_1/ChangeLog (revision 49629) @@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/ChangeLog#L1 +Wed Feb 18 00:18:12 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] + Tue Feb 17 22:59:31 2015 Nobuyoshi Nakada <nobu@r...> * lib/resolv.rb (Resolv::DNS::Resource#==, #hash): elements Index: ruby_2_1/lib/rdoc/text.rb =================================================================== --- ruby_2_1/lib/rdoc/text.rb (revision 49628) +++ ruby_2_1/lib/rdoc/text.rb (revision 49629) @@ -68,11 +68,11 @@ module RDoc::Text https://github.com/ruby/ruby/blob/trunk/ruby_2_1/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_1/version.h =================================================================== --- ruby_2_1/version.h (revision 49628) +++ ruby_2_1/version.h (revision 49629) @@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_1/version.h#L1 #define RUBY_VERSION "2.1.5" -#define RUBY_RELEASE_DATE "2015-02-17" -#define RUBY_PATCHLEVEL 294 +#define RUBY_RELEASE_DATE "2015-02-18" +#define RUBY_PATCHLEVEL 295 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 2 -#define RUBY_RELEASE_DAY 17 +#define RUBY_RELEASE_DAY 18 #include "ruby/version.h" Index: ruby_2_1/test/rdoc/test_rdoc_text.rb =================================================================== --- ruby_2_1/test/rdoc/test_rdoc_text.rb (revision 49628) +++ ruby_2_1/test/rdoc/test_rdoc_text.rb (revision 49629) @@ -56,6 +56,9 @@ class TestRDocText < RDoc::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_1/test/rdoc/test_rdoc_text.rb#L56 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_1 ___________________________________________________________________ Modified: svn:mergeinfo Merged /trunk:r49223 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/