summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-12 02:25:49 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-12 02:25:49 (GMT)
commit4852e7e6737713f4bc984796ee14593641a85587 (patch)
tree9fda7474a1e9f7a699f614c009dee62e3f1aff3a /ext/readline
parent0e2a3cccf61d391d30e2c2654102ff2179e3b7fe (diff)
fix r42527 again; [Bug #8760] [ruby-dev:47608] [ruby-dev:47609]
Remove check rl_instream != ifp->stdio_file. rl_instream is made from duped fd and we cannnot compare. This fix seems still buggy when rl_instream is manually changed from other extension libraries. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 825e0e6..0f76d1a 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -143,7 +143,6 @@ readline_getc(FILE *input)
VALUE c;
if (!readline_instream) return rl_getc(input);
GetOpenFile(readline_instream, ifp);
- if (rl_instream != ifp->stdio_file) return rl_getc(input);
#if defined(_WIN32)
{
INPUT_RECORD ir;
@@ -151,13 +150,13 @@ readline_getc(FILE *input)
static int prior_key = '0';
for (;;) {
if (prior_key > 0xff) {
- prior_key = rl_getc(ifp->stdio_file);
+ prior_key = rl_getc(rl_instream);
return prior_key;
}
if (PeekConsoleInput((HANDLE)_get_osfhandle(ifp->fd), &ir, 1, &n)) {
if (n == 1) {
if (ir.EventType == KEY_EVENT && ir.Event.KeyEvent.bKeyDown) {
- prior_key = rl_getc(ifp->stdio_file);
+ prior_key = rl_getc(rl_instream);
return prior_key;
} else {
ReadConsoleInput((HANDLE)_get_osfhandle(ifp->fd), &ir, 1, &n);
@@ -503,8 +502,6 @@ readline_s_set_input(VALUE self, VALUE input)
rb_sys_fail("fdopen");
}
rl_instream = f;
- if (f == stdin)
- ifp->stdio_file = f;
readline_instream = input;
}
return input;
@@ -559,8 +556,6 @@ readline_s_set_output(VALUE self, VALUE output)
rb_sys_fail("fdopen");
}
rl_outstream = f;
- if (f == stdout)
- ofp->stdio_file = f;
readline_outstream = output;
}
return output;