summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-20 04:33:59 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-05-20 04:33:59 +0000
commitb241a0680c4bcd0948ac501473be3a39839ebe87 (patch)
tree2439196595178f17e0ba3f94ed628fc8f09cb3ca
parenta61dbb92315b71013ce29f5289b3c229998ccbe6 (diff)
* 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
-rw-r--r--ChangeLog4
-rw-r--r--io.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 906d836..8301f6c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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:
diff --git a/io.c b/io.c
index ba6b695..14203f0 100644
--- a/io.c
+++ b/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);