[前][次][番号順一覧][スレッド一覧]

ruby-changes:30448

From: naruse <ko1@a...>
Date: Mon, 12 Aug 2013 10:04:15 +0900 (JST)
Subject: [ruby-changes:30448] naruse:r42527 (trunk): refix r42525 set stdio_file only if stdio

naruse	2013-08-12 10:04:01 +0900 (Mon, 12 Aug 2013)

  New Revision: 42527

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42527

  Log:
    refix r42525 set stdio_file only if stdio

  Modified files:
    trunk/ext/readline/readline.c
Index: ext/readline/readline.c
===================================================================
--- ext/readline/readline.c	(revision 42526)
+++ ext/readline/readline.c	(revision 42527)
@@ -503,7 +503,8 @@ readline_s_set_input(VALUE self, VALUE i https://github.com/ruby/ruby/blob/trunk/ext/readline/readline.c#L503
             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 https://github.com/ruby/ruby/blob/trunk/ext/readline/readline.c#L559
             rb_sys_fail("fdopen");
         }
         rl_outstream = f;
-        ofp->stdio_file = f;
+        if (f == stdout)
+            ofp->stdio_file = f;
         readline_outstream = output;
     }
     return output;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]