diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-15 14:13:47 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-15 14:13:47 +0000 |
commit | b18d76a6f1a27cde2df3422e933245eb36d1e81a (patch) | |
tree | dfd137841d9854cde6062f50c271de903fb0d169 /ext | |
parent | 53a0dcb32ac9f6450dce841664f0af104adc6ec3 (diff) |
* ext/readline/readline.c (Readline.readline): use rl_outstream
and rl_instream. [ruby-dev:25699]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/readline/readline.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 4c7b08f514..a8d2f82795 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -7,6 +7,7 @@ #include <readline/history.h> #include "ruby.h" +#include "rubyio.h" #include "rubysig.h" #ifdef HAVE_UNISTD_H @@ -45,6 +46,7 @@ readline_readline(argc, argv, self) char *prompt = NULL; char *buff; int status; + OpenFile *ofp, *ifp; rb_secure(4); if (rb_scan_args(argc, argv, "02", &tmp, &add_hist) > 0) { @@ -54,6 +56,10 @@ readline_readline(argc, argv, self) if (!isatty(0) && errno == EBADF) rb_raise(rb_eIOError, "stdin closed"); + GetOpenFile(rb_stdout, ofp); + rl_outstream = rb_io_stdio_file(ofp); + GetOpenFile(rb_stdin, ifp); + rl_instream = rb_io_stdio_file(ifp); buff = (char*)rb_protect((VALUE(*)_((VALUE)))readline, (VALUE)prompt, &status); if (status) { |