diff -Naurd rexml_3.1.7.3-orig/src/rexml/formatters/pretty.rb rexml_3.1.7.3/src/rexml/formatters/pretty.rb
|
old
|
new
|
|
| 126 | 126 | end |
| 127 | 127 | |
| 128 | 128 | def wrap(string, width) |
| 129 | | # Recursivly wrap string at width. |
| | 129 | # non-recursively wrap string at width. |
| 130 | 130 | return string if string.length <= width |
| 131 | | place = string.rindex(' ', width) # Position in string with last ' ' before cutoff |
| 132 | | return string[0,place] + "\n" + wrap(string[place+1..-1], width) |
| | 131 | acc = '' |
| | 132 | begin |
| | 133 | place = string.rindex(' ', width) # Position in string with last ' ' before cutoff |
| | 134 | break unless place |
| | 135 | acc << string[0,place] << "\n" |
| | 136 | string = string[place+1..-1] |
| | 137 | end while string.length > width |
| | 138 | acc << string |
| 133 | 139 | end |
| 134 | | |
| 135 | 140 | end |
| 136 | 141 | end |
| 137 | 142 | end |