mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
[ruby/io-console] Try fallback to stdout when stdin
https://github.com/ruby/io-console/commit/b8017509ef
This commit is contained in:
parent
8487193b10
commit
9e4be78ea8
1 changed files with 4 additions and 0 deletions
|
@ -1058,6 +1058,10 @@ direct_query(VALUE io, VALUE query)
|
|||
if (write(fptr->fd, RSTRING_PTR(query), RSTRING_LEN(query)) != -1) {
|
||||
return 1;
|
||||
}
|
||||
if (fptr->fd == 0 &&
|
||||
write(1, RSTRING_PTR(query), RSTRING_LEN(query)) != -1) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue