From 39acf90c07686087d12f1a7a39d161a535e0e97f Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 16 Jul 2009 07:00:23 +0000 Subject: * io.c (io_reopen): discards read buffer. [ruby-core:24240] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@24144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'io.c') diff --git a/io.c b/io.c index 9720145fc..b1d985e4f 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); -- cgit