Project

General

Profile

Bug #4024

IO#readlines(0) never return

Added by nagachika (Tomoyuki Chikanaga) almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-11-04 trunk 29690) [x86_64-darwin10.4.0]
Backport:
[ruby-dev:42538]

Description

=begin
1.9.2 および trunk で IO#readlines の引数に 0 を渡すと無限ループ状態になり処理がかえってこなくなります。
IO#each_line も同様に "" を yield し続けます。
(via http://twitter.com/#!/watson1978/status/29656929210)

readlines/each_line で limit に 0 が渡された時は例外にするのが良いのではないでしょうか。
パッチを添付します。
=end


Files

io_readlines.patch (1.35 KB) io_readlines.patch nagachika (Tomoyuki Chikanaga), 11/04/2010 11:08 PM
#1

Updated by nobu (Nobuyoshi Nakada) almost 10 years ago

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

=begin
This issue was solved with changeset r29694.
Tomoyuki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Also available in: Atom PDF