summaryrefslogtreecommitdiffstats
path: root/lib/rexml
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-23 11:09:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-23 11:09:39 +0000
commit6b2e15e1be99f46b0f1a85084a51d4cbe4b8a35f (patch)
tree3f4eedd07e6f838090e006944de0070fd3fd9b47 /lib/rexml
parent8b83b9b15c4456887ab4c1ab7c122f29cfa6f9ca (diff)
downloadruby-6b2e15e1be99f46b0f1a85084a51d4cbe4b8a35f.tar.gz
ruby-6b2e15e1be99f46b0f1a85084a51d4cbe4b8a35f.tar.xz
ruby-6b2e15e1be99f46b0f1a85084a51d4cbe4b8a35f.zip
* lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
abandon wrapping if the line contains no space. [ruby-dev:36045] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml')
-rw-r--r--lib/rexml/formatters/pretty.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/rexml/formatters/pretty.rb b/lib/rexml/formatters/pretty.rb
index 296e60768..84c442e8b 100644
--- a/lib/rexml/formatters/pretty.rb
+++ b/lib/rexml/formatters/pretty.rb
@@ -129,6 +129,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