ruby-changes:9416
From: akr <ko1@a...>
Date: Wed, 24 Dec 2008 00:22:38 +0900 (JST)
Subject: [ruby-changes:9416] Ruby:r20954 (trunk): * io.c (rb_io_init_copy): call io_seek only if io_tell succeeds.
akr 2008-12-24 00:22:18 +0900 (Wed, 24 Dec 2008) New Revision: 20954 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20954 Log: * io.c (rb_io_init_copy): call io_seek only if io_tell succeeds. Modified files: trunk/ChangeLog trunk/io.c Index: ChangeLog =================================================================== --- ChangeLog (revision 20953) +++ ChangeLog (revision 20954) @@ -1,11 +1,15 @@ +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 22:57:48 2008 Tanaka Akira <akr@f...> - * process.c (rb_fork): don't propagete an error message if error + * process.c (rb_fork): don't propagate an error message if error buffer not given. Tue Dec 23 21:55:05 2008 Tanaka Akira <akr@f...> - * process.c (rb_fork): propagete an error message from child to parent. + * process.c (rb_fork): propagate an error message from child to parent. (rb_f_exec): show details of error in child process on exception. (save_redirect_fd): add error message arguments. Index: io.c =================================================================== --- io.c (revision 20953) +++ io.c (revision 20954) @@ -5368,6 +5368,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; @@ -5386,7 +5387,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/