summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-11 17:25:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-11 17:25:57 +0000
commitcf587476f6fdd39c8f6968db08ccef205fa5b9a1 (patch)
tree47db064ab69163c62130850e7c228d8377509b92 /io.c
parent043696a9ae007dbb9f627ad95f068a52e7922c4f (diff)
downloadruby-cf587476f6fdd39c8f6968db08ccef205fa5b9a1.tar.gz
ruby-cf587476f6fdd39c8f6968db08ccef205fa5b9a1.tar.xz
ruby-cf587476f6fdd39c8f6968db08ccef205fa5b9a1.zip
* io.c (rb_io_reopen): clear read buffer.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@17100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 ced6a7aed..a53e5589b 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) {