* io.c (rb_io_clone): writing stream was not copied properly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a61dbb9231
commit
b241a0680c
@ -1,3 +1,7 @@
|
||||
Mon May 20 13:28:52 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||
|
||||
* io.c (rb_io_clone): writing stream was not copied properly.
|
||||
|
||||
Sat May 18 21:38:11 2002 Tadayoshi Funaba <tadf@dotrb.org>
|
||||
|
||||
* lib/date.rb, lib/date/format.rb, lib/parsedate.rb:
|
||||
|
4
io.c
4
io.c
@ -2227,11 +2227,11 @@ rb_io_clone(io)
|
||||
}
|
||||
fd = ruby_dup(fileno(orig->f));
|
||||
fptr->f = rb_fdopen(fd, mode);
|
||||
if (fptr->f2) {
|
||||
if (orig->f2) {
|
||||
if (fileno(orig->f) != fileno(orig->f2)) {
|
||||
fd = ruby_dup(fileno(orig->f2));
|
||||
}
|
||||
fptr->f = rb_fdopen(fd, "w");
|
||||
fptr->f2 = rb_fdopen(fd, "w");
|
||||
}
|
||||
if (fptr->mode & FMODE_BINMODE) {
|
||||
rb_io_binmode(clone);
|
||||
|
Loading…
x
Reference in New Issue
Block a user