diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-23 19:27:18 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2019-09-23 19:29:36 +0900 |
commit | 9e4be78ea88f882e1562dbb3eeb24304d0049b8d (patch) | |
tree | 31f28638f6ed95230b7c1b30ab9a875aefb34282 /ext/io | |
parent | 8487193b109ab8cecea74ff383b01b5ecce172c4 (diff) |
[ruby/io-console] Try fallback to stdout when stdin
https://github.com/ruby/io-console/commit/b8017509ef
Diffstat (limited to 'ext/io')
-rw-r--r-- | ext/io/console/console.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c index f5a32a8fbb..cd47f1e3d0 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -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; } |