[前][次][番号順一覧][スレッド一覧]

ruby-changes:3601

From: ko1@a...
Date: Fri, 18 Jan 2008 00:51:07 +0900 (JST)
Subject: [ruby-changes:3601] nobu - Ruby:r15090 (trunk): * io.c (rb_io_check_readable): flush tied write IO too.

nobu	2008-01-18 00:49:33 +0900 (Fri, 18 Jan 2008)

  New Revision: 15090

  Modified files:
    trunk/ChangeLog
    trunk/io.c

  Log:
    * io.c (rb_io_check_readable): flush tied write IO too.
    
    * io.c (Init_IO): tie stdin with stdout.  [ruby-core:15107]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15090&r2=15089&diff_format=u
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/io.c?r1=15090&r2=15089&diff_format=u

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 15089)
+++ ChangeLog	(revision 15090)
@@ -1,3 +1,9 @@
+Fri Jan 18 00:49:31 2008  Nobuyoshi Nakada  <nobu@r...>
+
+	* io.c (rb_io_check_readable): flush tied write IO too.
+
+	* io.c (Init_IO): tie stdin with stdout.  [ruby-core:15107]
+
 Fri Jan 18 00:23:31 2008  Nobuyoshi Nakada  <nobu@r...>
 
 	* encoding.c (enc_free): removed since rb_encoding may be used while
Index: io.c
===================================================================
--- io.c	(revision 15089)
+++ io.c	(revision 15090)
@@ -363,6 +363,11 @@
     if (fptr->wbuf_len) {
         io_fflush(fptr);
     }
+    if (fptr->tied_io_for_writing) {
+	rb_io_t *wfptr;
+	GetOpenFile(fptr->tied_io_for_writing, wfptr);
+	io_fflush(wfptr);
+    }
     if (!fptr->enc && fptr->fd == 0) {
 	fptr->enc = rb_default_external_encoding();
     }
@@ -6647,6 +6652,7 @@
     rb_define_hooked_variable("$>", &rb_stdout, 0, stdout_setter);
     orig_stdout = rb_stdout;
     rb_deferr = orig_stderr = rb_stderr;
+    RFILE(rb_stdin)->fptr->tied_io_for_writing = rb_stdout;
 
     /* constants to hold original stdin/stdout/stderr */
     rb_define_global_const("STDIN", rb_stdin);

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]