summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-19 02:21:04 +0000
committershugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-08-19 02:21:04 +0000
commit4a49c6555a441ff2bfd0ac63608db2153a9fab7e (patch)
tree9c27010b4db2ab1cf10a6a253f439cbf669e1768
parente986e7123643b91ece134ea47db9935670108ca2 (diff)
downloadruby-4a49c6555a441ff2bfd0ac63608db2153a9fab7e.tar.gz
ruby-4a49c6555a441ff2bfd0ac63608db2153a9fab7e.tar.xz
ruby-4a49c6555a441ff2bfd0ac63608db2153a9fab7e.zip
* io.c (next_argv): should not call GetOpenFile() if rb_stdout is
not a IO (T_FILE). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@4408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--io.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 63c1ee6b2..3f7577ebd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Aug 19 11:19:33 2003 Shugo Maeda <shugo@ruby-lang.org>
+
+ * io.c (next_argv): should not call GetOpenFile() if rb_stdout is
+ not a IO (T_FILE).
+
Tue Aug 19 07:47:09 2003 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_ssl.c: sync_close is moved to SSLSocket as
diff --git a/io.c b/io.c
index b6dfd05c9..3e623e29b 100644
--- a/io.c
+++ b/io.c
@@ -2963,9 +2963,11 @@ next_argv()
OpenFile *fptr;
int stdout_binmode = 0;
- GetOpenFile(rb_stdout, fptr);
- if (fptr->mode & FMODE_BINMODE)
- stdout_binmode = 1;
+ if (TYPE(rb_stdout) == T_FILE) {
+ GetOpenFile(rb_stdout, fptr);
+ if (fptr->mode & FMODE_BINMODE)
+ stdout_binmode = 1;
+ }
if (init_p == 0) {
if (RARRAY(rb_argv)->len > 0) {