summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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);