mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 02:53:57 +02:00
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
459c590ca8
commit
9dd9feab8a
4 changed files with 14 additions and 5 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
Mon Jan 19 11:44:52 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/rdoc/text.rb (expand_tabs): get rid of infinite loop with
|
||||||
|
CR. should check if substitution occurred too.
|
||||||
|
[ruby-dev:48813] [Bug #10732]
|
||||||
|
|
||||||
Sun Jan 18 00:59:41 2015 Eric Wong <e@80x24.org>
|
Sun Jan 18 00:59:41 2015 Eric Wong <e@80x24.org>
|
||||||
|
|
||||||
* numeric.c (bit_coerce): use original value for error message
|
* numeric.c (bit_coerce): use original value for error message
|
||||||
|
|
|
@ -68,11 +68,11 @@ module RDoc::Text
|
||||||
expanded = []
|
expanded = []
|
||||||
|
|
||||||
text.each_line do |line|
|
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 = "#{$1}#{$2}#{' ' * (8 - $2.size)}"
|
||||||
r.force_encoding text.encoding if Object.const_defined? :Encoding
|
r.force_encoding text.encoding if Object.const_defined? :Encoding
|
||||||
r
|
r
|
||||||
end until line !~ /\t/
|
end
|
||||||
|
|
||||||
expanded << line
|
expanded << line
|
||||||
end
|
end
|
||||||
|
|
|
@ -56,6 +56,9 @@ class TestRDocText < RDoc::TestCase
|
||||||
|
|
||||||
assert_equal('. .',
|
assert_equal('. .',
|
||||||
expand_tabs(".\t\t."), 'dot tab tab dot')
|
expand_tabs(".\t\t."), 'dot tab tab dot')
|
||||||
|
|
||||||
|
assert_equal('a a',
|
||||||
|
Timeout.timeout(1) {expand_tabs("\ra\ta")}, "carriage return")
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_expand_tabs_encoding
|
def test_expand_tabs_encoding
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
#define RUBY_VERSION "2.2.0"
|
#define RUBY_VERSION "2.2.0"
|
||||||
#define RUBY_RELEASE_DATE "2015-01-18"
|
#define RUBY_RELEASE_DATE "2015-01-19"
|
||||||
#define RUBY_PATCHLEVEL 27
|
#define RUBY_PATCHLEVEL 28
|
||||||
|
|
||||||
#define RUBY_RELEASE_YEAR 2015
|
#define RUBY_RELEASE_YEAR 2015
|
||||||
#define RUBY_RELEASE_MONTH 1
|
#define RUBY_RELEASE_MONTH 1
|
||||||
#define RUBY_RELEASE_DAY 18
|
#define RUBY_RELEASE_DAY 19
|
||||||
|
|
||||||
#include "ruby/version.h"
|
#include "ruby/version.h"
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue