Project

General

Profile

Actions

Bug #516

closed

REXML::Text#wrapは空白が含まれない場合を想定していない

Added by sakuro (Sakuro OZAWA) about 16 years ago. Updated over 13 years ago.

Status:
Closed
Target version:
-
ruby -v:
Backport:
[ruby-dev:36045]

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

sample.rb (318 Bytes) sample.rb 再現スクリプト sakuro (Sakuro OZAWA), 08/29/2008 11:49 PM

Related issues 1 (0 open1 closed)

Related to Ruby 1.8 - Bug #342: [PATCH] REXML Pretty Formatter's private method wrap breaks if no space is foundClosed07/22/2008Actions
Actions #1

Updated by ko1 (Koichi Sasada) about 16 years ago

  • Assignee set to matz (Yukihiro Matsumoto)

=begin

=end

Actions #2

Updated by ko1 (Koichi Sasada) about 16 years ago

  • Assignee changed from matz (Yukihiro Matsumoto) to ser (Sean Russell)

=begin

=end

Actions #3

Updated by matz (Yukihiro Matsumoto) about 16 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r19487.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0