summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-16 07:00:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-16 07:00:23 +0000
commit53163f8138e1e0d1c0f91351a8cfe8749151d56e (patch)
treeec4c71aa968a4c9e52b246edb02bc8e1af49b324 /io.c
parent5e65d8f433f555af052ae6a32f42adb897778c58 (diff)
* io.c (io_reopen): discards read buffer. [ruby-core:24240]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/io.c b/io.c
index 9720145fc1..b1d985e4f5 100644
--- a/io.c
+++ b/io.c
@@ -5648,6 +5648,9 @@ io_reopen(VALUE io, VALUE nfile)
if (io_fflush(fptr) < 0)
rb_sys_fail(0);
}
+ else {
+ io_tell(fptr);
+ }
/* copy rb_io_t structure */
fptr->mode = orig->mode | (fptr->mode & FMODE_PREP);