don't use READ_DATA_PENDING in previous change

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2004-11-28 17:02:14 +00:00
parent da9166cc19
commit a8f25ded9c
2 changed files with 3 additions and 7 deletions

View File

@ -1,10 +1,7 @@
Mon Nov 29 01:18:18 2004 Tanaka Akira <akr@m17n.org>
* io.c (rb_io_check_writable): restrict io_seek by
READ_DATA_PENDING because io_seek(fptr, 0, SEEK_CUR) is
meaningful only if read buffer is not empty.
call io_seek regardless of NEED_IO_SEEK_BETWEEN_RW.
[ruby-dev:24986]
* io.c (rb_io_check_writable): call io_seek regardless of
NEED_IO_SEEK_BETWEEN_RW. [ruby-dev:24986]
Sun Nov 28 15:57:58 2004 Kouhei Sutou <kou@cozmixng.org>

3
io.c
View File

@ -261,8 +261,7 @@ rb_io_check_writable(fptr)
if (!(fptr->mode & FMODE_WRITABLE)) {
rb_raise(rb_eIOError, "not opened for writing");
}
if ((fptr->mode & FMODE_RBUF) && !feof(fptr->f) && !fptr->f2 &&
READ_DATA_PENDING(fptr->f)) {
if ((fptr->mode & FMODE_RBUF) && !feof(fptr->f) && !fptr->f2) {
io_seek(fptr, 0, SEEK_CUR);
}
if (!fptr->f2) {