From 231f7cb95ff551c4e1aa4c67d22bc36143b0ff42 Mon Sep 17 00:00:00 2001 From: akr Date: Tue, 9 Dec 2003 05:12:52 +0000 Subject: io.c (rb_io_check_writable): don't call io_seek if EOF flag is set, to avoid clearing EOF flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'io.c') diff --git a/io.c b/io.c index aa3fc5536c..593e1facc2 100644 --- a/io.c +++ b/io.c @@ -243,7 +243,7 @@ rb_io_check_writable(fptr) rb_raise(rb_eIOError, "not opened for writing"); } #if NEED_IO_SEEK_BETWEEN_RW - if ((fptr->mode & FMODE_RBUF) && !fptr->f2) { + if ((fptr->mode & FMODE_RBUF) && !feof(fptr->f) && !fptr->f2) { io_seek(fptr, 0, SEEK_CUR); } #endif -- cgit v1.2.3