Actions
Bug #1203
closedIO#gets ignores the limit parameter when sep is nil
Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.2dev (2009-02-24 trunk 22588) [i686-linux]
Backport:
Description
=begin
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.
=end
Actions
Like0
Like0