diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-26 04:15:02 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-05-26 04:15:02 +0000 |
commit | 13ebee7a9e4c38d7f89b0cbed9036b2692ff3c42 (patch) | |
tree | c8f6c02c052c6afe097a415dd498a2d7ce64efb5 | |
parent | b216b65ce90978d164860513b27d249ef43e7ee2 (diff) | |
download | ruby-13ebee7a9e4c38d7f89b0cbed9036b2692ff3c42.tar.gz |
* io.c (rb_io_init_copy): copy also positions. [ruby-talk:100910]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6406 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | io.c | 2 |
2 files changed, 6 insertions, 0 deletions
@@ -1,3 +1,7 @@ +Wed May 26 13:14:52 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * io.c (rb_io_init_copy): copy also positions. [ruby-talk:100910] + Wed May 26 00:00:00 2004 why the lucky stiff <why@ruby-lang.org> * ext/syck/syck.c (syck_new_parser): clear parser on init. @@ -3331,11 +3331,13 @@ rb_io_init_copy(dest, io) } fd = ruby_dup(fileno(orig->f)); fptr->f = rb_fdopen(fd, mode); + fseeko(fptr->f, ftello(orig->f), SEEK_SET); if (orig->f2) { if (fileno(orig->f) != fileno(orig->f2)) { fd = ruby_dup(fileno(orig->f2)); } fptr->f2 = rb_fdopen(fd, "w"); + fseeko(fptr->f2, ftello(orig->f2), SEEK_SET); } if (fptr->mode & FMODE_BINMODE) { rb_io_binmode(dest); |