summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-09 05:12:52 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-09 05:12:52 +0000
commit9a8de76d53fae373f2be5178e981ac7be469943d (patch)
treed1249aa09c93d57223671885eb7f85663f892733
parent26e49252fd03a9bd0ed73105699ccec6d9623987 (diff)
downloadruby-9a8de76d53fae373f2be5178e981ac7be469943d.tar.gz
ruby-9a8de76d53fae373f2be5178e981ac7be469943d.tar.xz
ruby-9a8de76d53fae373f2be5178e981ac7be469943d.zip
io.c (rb_io_check_writable): don't call io_seek if EOF flag is set,
to avoid clearing EOF flag. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--io.c2
2 files changed, 5 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 60ff6ca58..4ef0c2754 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
-Tue Dec 9 12:49:22 2003 Tanaka Akira <akr@m17n.org>
+Tue Dec 9 14:10:48 2003 Tanaka Akira <akr@m17n.org>
- * io.c (rb_io_check_readable): Don't clear EOF flag by io_seek.
+ * io.c (rb_io_check_readable): don't call io_seek if EOF flag is set,
+ to avoid clearing EOF flag.
+ (rb_io_check_writable): ditto.
Tue Dec 9 02:53:55 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
diff --git a/io.c b/io.c
index aa3fc5536..593e1facc 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