ruby-changes:7965
From: matz <ko1@a...>
Date: Tue, 23 Sep 2008 20:09:58 +0900 (JST)
Subject: [ruby-changes:7965] Ruby:r19487 (trunk): * lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap):
matz 2008-09-23 20:09:39 +0900 (Tue, 23 Sep 2008) New Revision: 19487 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=19487 Log: * lib/rexml/formatters/pretty.rb (REXML::Formatters::Pretty#wrap): abandon wrapping if the line contains no space. [ruby-dev:36045] Modified files: trunk/ChangeLog trunk/lib/rexml/formatters/pretty.rb Index: ChangeLog =================================================================== --- ChangeLog (revision 19486) +++ ChangeLog (revision 19487) @@ -1,3 +1,8 @@ +Tue Sep 23 20:06:46 2008 Yukihiro Matsumoto <matz@r...> + + * 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@r...> * win32/win32.c (subtruct): check tv_sec. reported by ko1. Index: lib/rexml/formatters/pretty.rb =================================================================== --- lib/rexml/formatters/pretty.rb (revision 19486) +++ lib/rexml/formatters/pretty.rb (revision 19487) @@ -129,6 +129,7 @@ # 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/