diff options
Diffstat (limited to 'ext/stringio')
-rw-r--r-- | ext/stringio/stringio.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index 725b5be192..f94c860728 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -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 { |