Bug #516
closed
REXML::Text#wrapは空白が含まれない場合を想定していない
Added by sakuro (Sakuro OZAWA) about 16 years ago.
Updated over 13 years ago.
Description
=begin
空白が含まれない string に対して place = string.rindex(' ', width) とすると nil が返るところ、
これをチェックせずそのまま分割位置に利用しています。
$ ruby-trunk sample.rb
ruby 1.9.0 (2008-08-29 revision 18925) [i386-darwin9.4.0]
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
/usr/local/lib/ruby/1.9.0/rexml/formatters/pretty.rb:132:in `[]': no implicit conversion from nil to integer (TypeError)
from /usr/local/lib/ruby/1.9.0/rexml/formatters/pretty.rb:132:in `wrap'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/pretty.rb:91:in `write_text'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/default.rb:50:in `write'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/pretty.rb:76:in `block in write_element'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/pretty.rb:74:in `each'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/pretty.rb:74:in `write_element'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/default.rb:31:in `write'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/pretty.rb:118:in `block in write_document'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/pretty.rb:112:in `each'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/pretty.rb:112:in `write_document'
from /usr/local/lib/ruby/1.9.0/rexml/formatters/default.rb:28:in `write'
from sample.rb:11:in `'
=end
Files
- Assignee set to matz (Yukihiro Matsumoto)
- Assignee changed from matz (Yukihiro Matsumoto) to ser (Sean Russell)
- Status changed from Open to Closed
- % Done changed from 0 to 100
=begin
Applied in changeset r19487.
=end
Also available in: Atom
PDF
Like0
Like0Like0Like0