From 4852e7e6737713f4bc984796ee14593641a85587 Mon Sep 17 00:00:00 2001 From: naruse Date: Mon, 12 Aug 2013 02:25:49 +0000 Subject: 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 --- ext/readline/readline.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'ext/readline') diff --git a/ext/readline/readline.c b/ext/readline/readline.c index 825e0e6829..0f76d1a902 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; -- cgit v1.2.3