summaryrefslogtreecommitdiff
path: root/ext/readline
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-12 01:04:01 (GMT)
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-12 01:04:01 (GMT)
commit0e2a3cccf61d391d30e2c2654102ff2179e3b7fe (patch)
tree31438fd99fc741810f451ee31787c21bf2f069cb /ext/readline
parent4e742f4b40035f709962da2629dc4b45ad5a686a (diff)
refix r42525 set stdio_file only if stdio
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/readline')
-rw-r--r--ext/readline/readline.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 65f4ea0..825e0e6 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -503,7 +503,8 @@ readline_s_set_input(VALUE self, VALUE input)
rb_sys_fail("fdopen");
}
rl_instream = f;
- ifp->stdio_file = f;
+ if (f == stdin)
+ ifp->stdio_file = f;
readline_instream = input;
}
return input;
@@ -558,7 +559,8 @@ readline_s_set_output(VALUE self, VALUE output)
rb_sys_fail("fdopen");
}
rl_outstream = f;
- ofp->stdio_file = f;
+ if (f == stdout)
+ ofp->stdio_file = f;
readline_outstream = output;
}
return output;