diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-17 09:38:10 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-07-17 09:38:10 +0000 |
commit | 448e63d627bf3653da0b3dc0dcf93e161829dc71 (patch) | |
tree | f79b454b1c6352c12dae4915f0e136c228d71a9f /io.c | |
parent | 23dd3051c06c781b3905c993fd8fc1b3ccff6b81 (diff) | |
download | ruby-448e63d627bf3653da0b3dc0dcf93e161829dc71.tar.gz |
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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; |