From 448e63d627bf3653da0b3dc0dcf93e161829dc71 Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 17 Jul 2000 09:38:10 +0000 Subject: matz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index f3fd315323..dabc680549 100644 --- a/io.c +++ b/io.c @@ -1793,7 +1793,7 @@ io_reopen(io, nfile) fd = fileno(fptr->f); if (fd < 3) { clearerr(fptr->f); - /* need to keep stdio */ + /* need to keep stdio objects */ if (dup2(fileno(orig->f), fd) < 0) rb_sys_fail(orig->path); } @@ -1802,10 +1802,10 @@ io_reopen(io, nfile) if (dup2(fileno(orig->f), fd) < 0) rb_sys_fail(orig->path); fptr->f = rb_fdopen(fd, mode); - if (orig->mode & FMODE_READABLE && pos >= 0) { - fseek(fptr->f, pos, SEEK_SET); - fseek(orig->f, pos, SEEK_SET); - } + } + if ((orig->mode & FMODE_READABLE) && pos >= 0) { + fseek(fptr->f, pos, SEEK_SET); + fseek(orig->f, pos, SEEK_SET); } if (fptr->f2) { @@ -1887,6 +1887,7 @@ static VALUE rb_io_clone(io) VALUE io; { + VALUE klass; OpenFile *fptr, *orig; int fd; char *mode; -- cgit v1.2.3