summaryrefslogtreecommitdiff
path: root/ext/stringio/stringio.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/stringio/stringio.c')
-rw-r--r--ext/stringio/stringio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c
index d6d5b7694a..0fb60069de 100644
--- a/ext/stringio/stringio.c
+++ b/ext/stringio/stringio.c
@@ -849,6 +849,9 @@ strio_read(argc, argv, self)
ptr->flags |= STRIO_EOF;
return Qnil;
}
+ else if (ptr->flags & STRIO_EOF) {
+ return Qnil;
+ }
break;
}
/* fall through */
@@ -856,6 +859,7 @@ strio_read(argc, argv, self)
len = RSTRING(ptr->string)->len - ptr->pos;
if (len == 0 && ptr->pos == RSTRING(ptr->string)->len) {
if (ptr->flags & STRIO_EOF) return Qnil;
+ ptr->flags |= STRIO_EOF;
}
break;
default: