From 7510468707b8e2f05258afb4147210162a812444 Mon Sep 17 00:00:00 2001 From: naruse Date: Fri, 21 Aug 2009 06:04:21 +0000 Subject: use rl_prep_terminal only on Windows. [ruby-core:25009] * ext/readline/readline.c (readline_readline): use rb_prep_terminal only on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/readline/readline.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ext/readline') diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 25b8013177..abb9a0a33a 100644 --- a/ext/readline/readline.c +++ b/ext/readline/readline.c @@ -144,7 +144,6 @@ readline_event(void) static VALUE readline_get(VALUE prompt) { - rl_prep_terminal(1); return (VALUE)readline((char *)prompt); } @@ -250,6 +249,9 @@ readline_readline(int argc, VALUE *argv, VALUE self) if (!isatty(0) && errno == EBADF) rb_raise(rb_eIOError, "closed stdin"); +#ifdef _WIN32 + rl_prep_terminal(1); +#endif buff = (char*)rb_protect(readline_get, (VALUE)prompt, &status); if (status) { #if defined HAVE_RL_CLEANUP_AFTER_SIGNAL -- cgit v1.2.3