mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
d486686eb7
commit
b8f04a8bcb
1 changed files with 7 additions and 2 deletions
9
io.c
9
io.c
|
@ -801,8 +801,13 @@ static int
|
||||||
io_getc(OpenFile *fptr)
|
io_getc(OpenFile *fptr)
|
||||||
{
|
{
|
||||||
int r;
|
int r;
|
||||||
if (fptr->fd == 0 && (fptr->mode & FMODE_TTY)) {
|
if (fptr->fd == 0 && (fptr->mode & FMODE_TTY) &&
|
||||||
rb_io_flush(rb_stdout);
|
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) {
|
if (fptr->rbuf == NULL) {
|
||||||
fptr->rbuf_off = 0;
|
fptr->rbuf_off = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue