summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-21 06:04:21 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-21 06:04:21 +0000
commit7510468707b8e2f05258afb4147210162a812444 (patch)
tree9adcaad1069f1d96720692e2dc1fb8fd195b2246 /ext/readline
parent09cbac3f868afd26a2aa73c45fb0765d5f116f4e (diff)
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
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 25b8013..abb9a0a 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