diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-23 11:09:39 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-09-23 11:09:39 +0000 |
commit | 83abcf5a2c174bb76f258384d3a8f90cc5014928 (patch) | |
tree | 3f4eedd07e6f838090e006944de0070fd3fd9b47 | |
parent | 6b90013d1e4a3d0a4eee024d5f50d15560795f9f (diff) | |
download | ruby-83abcf5a2c174bb76f258384d3a8f90cc5014928.tar.gz |
* lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
abandon wrapping if the line contains no space. [ruby-dev:36045]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/rexml/formatters/pretty.rb | 1 |
2 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,8 @@ +Tue Sep 23 20:06:46 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap): + abandon wrapping if the line contains no space. [ruby-dev:36045] + Tue Sep 23 19:38:03 2008 NAKAMURA Usaku <usa@ruby-lang.org> * win32/win32.c (subtruct): check tv_sec. reported by ko1. diff --git a/lib/rexml/formatters/pretty.rb b/lib/rexml/formatters/pretty.rb index 296e607687..84c442e8bb 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 |