diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-17 15:49:33 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-01-17 15:49:33 +0000 |
| commit | c5522a5278ac00b3f78ddfbe59c0d4d0d4842b59 (patch) | |
| tree | dc685624ff0eb260946fd860699a6e26539eec7b | |
| parent | cd8c8a704b3a1c359d1bffc50bdd1386bd622541 (diff) | |
| download | ruby-c5522a5278ac00b3f78ddfbe59c0d4d0d4842b59.tar.gz ruby-c5522a5278ac00b3f78ddfbe59c0d4d0d4842b59.tar.xz ruby-c5522a5278ac00b3f78ddfbe59c0d4d0d4842b59.zip | |
* io.c (rb_io_check_readable): flush tied write IO too.
* io.c (Init_IO): tie stdin with stdout. [ruby-core:15107]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@15090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | io.c | 6 |
2 files changed, 12 insertions, 0 deletions
@@ -1,3 +1,9 @@ +Fri Jan 18 00:49:31 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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@ruby-lang.org> * encoding.c (enc_free): removed since rb_encoding may be used while @@ -363,6 +363,11 @@ rb_io_check_readable(rb_io_t *fptr) 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 @@ Init_IO(void) 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); |
