Bug #1203: IO#gets ignores the limit parameter when sep is nil
http://redmine.ruby-lang.org/issues/show/1203

Author: Michael Selig
Status: Open, Priority: Normal
Category: core
ruby -v: ruby 1.9.2dev (2009-02-24 trunk 22588) [i686-linux]

According to the doc f.gets(nil) returns the rest of the file. This works fine. But the doc also says that "limit" should restrict the length of the character string returned. Therefore I expect
     f.gets(nil, 10)
to return the next 10 bytes in the file (rounded up to a character boundary).
However it also seems to return the rest of the file - limit seems to be ignored here.

[Proposal] See issue 908 - I would also like "limit" to mean "characters" not bytes in 1.9. That would allow f.gets(nil, len) to read the next "len" characters in the file, ignoring newlines.


----------------------------------------
http://redmine.ruby-lang.org