summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-20 08:30:43 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-20 08:30:43 +0000
commit34fff376ffbbf8e1fcff501869f043003f88edd5 (patch)
treeb9bf11810344c37961a4767abfaad80f26985330
parent6a04a2c7d84e68f4720174272e41039881066d85 (diff)
* io.c (rb_io_check_writable): no need to check read buffer if
already changed to write mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6801 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--io.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ca520dcbe28..1918cc2295d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Aug 20 14:49:42 2004 NAKAMURA Usaku <usa@ruby-lang.org>
+
+ * io.c (rb_io_check_writable): no need to check read buffer if
+ already changed to write mode.
+
Fri Aug 20 11:46:43 2004 UENO Katsuhiro <katsu@blue.sky.or.jp>
* ext/zlib/zlib.c: GzipReader#ungetc caused crc error.
diff --git a/io.c b/io.c
index d64e41d683b..45056040bbf 100644
--- a/io.c
+++ b/io.c
@@ -254,7 +254,7 @@ rb_io_check_writable(fptr)
if (!(fptr->mode & FMODE_WRITABLE)) {
rb_raise(rb_eIOError, "not opened for writing");
}
- if (READ_DATA_BUFFERED(fptr->f)) {
+ if ((fptr->mode & FMODE_RBUF) && READ_DATA_BUFFERED(fptr->f)) {
rb_warn("read buffer data lost");
}
#if NEED_IO_SEEK_BETWEEN_RW