summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io.c b/io.c
index ced6a7aed7..a53e5589b6 100644
--- a/io.c
+++ b/io.c
@@ -4463,6 +4463,7 @@ rb_io_reopen(int argc, VALUE *argv, VALUE file)
if (fptr->mode & FMODE_WRITABLE) {
io_fflush(fptr);
}
+ fptr->rbuf_off = fptr->rbuf_len = 0;
if (fptr->stdio_file) {
if (freopen(fptr->path, mode, fptr->stdio_file) == 0) {