1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/stringio/stringio.c (strio_read): adjust behavior at reading

beyond EOF to IO.  [ruby-dev:22205]

* test/ruby/ut_eof.rb (TestEOF::Seek): test behaviors at reading
  beyond EOF.

* test/ruby/test_file.rb, * test/stringio/test_stringio.rb:
  include TestEOF::Seek test case.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-12-10 08:16:14 +00:00
parent d6ce2b7b2b
commit 6395c3b38d
5 changed files with 49 additions and 6 deletions

View file

@ -867,6 +867,7 @@ strio_read(argc, argv, self)
}
str = rb_str_substr(ptr->string, ptr->pos, len);
if (NIL_P(str)) {
if (!(ptr->flags & STRIO_EOF)) str = rb_str_new(0, 0);
ptr->flags |= STRIO_EOF;
}
else {