diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-07 14:40:22 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-07 14:40:22 +0000 |
commit | b8f04a8bcba7a059d1ccd95f4ba5dfb01e8e2c67 (patch) | |
tree | 3c5c76078df9494d4fd3a46bd2e42aacca273d7e /io.c | |
parent | d486686eb768619714328bff86be8e7711c2e967 (diff) | |
download | ruby-b8f04a8bcba7a059d1ccd95f4ba5dfb01e8e2c67.tar.gz |
fix previous commit to check stdout is a tty.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -801,8 +801,13 @@ static int io_getc(OpenFile *fptr) { int r; - if (fptr->fd == 0 && (fptr->mode & FMODE_TTY)) { - rb_io_flush(rb_stdout); + if (fptr->fd == 0 && (fptr->mode & FMODE_TTY) && + TYPE(rb_stdout) == T_FILE) { + OpenFile *ofp; + GetOpenFile(rb_stdout, ofp); + if (ofp->mode & FMODE_TTY) { + rb_io_flush(rb_stdout); + } } if (fptr->rbuf == NULL) { fptr->rbuf_off = 0; |