Project

General

Profile

Actions

Bug #4024

closed

IO#readlines(0) never return

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

Status:
Closed
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

Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #18767: IO.foreach hangs up when passes limit=0ClosedActions
Actions #1

Updated by nobu (Nobuyoshi Nakada) over 13 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

Actions #2

Updated by mame (Yusuke Endoh) almost 2 years ago

  • Related to Bug #18767: IO.foreach hangs up when passes limit=0 added
Actions

Also available in: Atom PDF

Like0
Like0Like0