ruby-changes:9480
From: yugui <ko1@a...>
Date: Thu, 25 Dec 2008 18:54:53 +0900 (JST)
Subject: [ruby-changes:9480] Ruby:r21018 (ruby_1_9_1): merges r20954 from trunk into ruby_1_9_1.
yugui 2008-12-25 18:54:32 +0900 (Thu, 25 Dec 2008) New Revision: 21018 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21018 Log: merges r20954 from trunk into ruby_1_9_1. * io.c (rb_io_init_copy): call io_seek only if io_tell succeeds. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/io.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21017) +++ ruby_1_9_1/ChangeLog (revision 21018) @@ -1,3 +1,7 @@ +Tue Dec 23 23:49:37 2008 Tanaka Akira <akr@f...> + + * io.c (rb_io_init_copy): call io_seek only if io_tell succeeds. + Tue Dec 23 20:28:28 2008 Yuki Sonoda (Yugui) <yugui@y...> * io.c: rdoc for File::open and 1.9 feature in file modes. Index: ruby_1_9_1/io.c =================================================================== --- ruby_1_9_1/io.c (revision 21017) +++ ruby_1_9_1/io.c (revision 21018) @@ -5338,6 +5338,7 @@ rb_io_t *fptr, *orig; int fd; VALUE write_io; + off_t pos; io = rb_io_get_io(io); if (dest == io) return dest; @@ -5356,7 +5357,9 @@ fd = ruby_dup(orig->fd); fptr->fd = fd; - io_seek(fptr, io_tell(orig), SEEK_SET); + pos = io_tell(orig); + if (0 <= pos) + io_seek(fptr, pos, SEEK_SET); if (fptr->mode & FMODE_BINMODE) { rb_io_binmode(dest); } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/