diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-24 15:07:30 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-01-24 15:07:30 +0000 |
commit | 20178fc002419a3e3673025d1d3637a35e0b4465 (patch) | |
tree | 6d54c9c64902d0a554d3f58dd574f347a42f724e /lib/rexml | |
parent | a8e3b7deeff0722c7c52e0ca3e03b47b3a5ff7ec (diff) |
merge revision(s) 19511:
* lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
abandon wrapping if the line contains no space. [ruby-dev:36045]
fix: #342
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@21759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r-- | lib/rexml/formatters/pretty.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rexml/formatters/pretty.rb b/lib/rexml/formatters/pretty.rb index d21175d34a..dd03626a21 100644 --- a/lib/rexml/formatters/pretty.rb +++ b/lib/rexml/formatters/pretty.rb @@ -128,6 +128,7 @@ module REXML # Recursively wrap string at width. return string if string.length <= width place = string.rindex(' ', width) # Position in string with last ' ' before cutoff + return string if place.nil? return string[0,place] + "\n" + wrap(string[place+1..-1], width) end |