diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-12 09:24:28 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-12 09:24:28 +0000 |
commit | 3ffea7382eb417d535a9df60e544d90f5d98178c (patch) | |
tree | 29002e7493ec7f910e1fb09956c26e48b9c0002c /io.c | |
parent | 495032ce8330765bf8066156af2680d105f39d6c (diff) | |
download | ruby-3ffea7382eb417d535a9df60e544d90f5d98178c.tar.gz ruby-3ffea7382eb417d535a9df60e544d90f5d98178c.tar.xz ruby-3ffea7382eb417d535a9df60e544d90f5d98178c.zip |
* io.c (next_argv): inherit binmode from $defout.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -2885,6 +2885,12 @@ next_argv() { extern VALUE rb_argv; char *fn; + OpenFile *fptr; + int defout_binmode = 0; + + GetOpenFile(rb_defout, fptr); + if (fptr->mode | FMODE_BINMODE) + defout_binmode = 1; if (init_p == 0) { if (RARRAY(rb_argv)->len > 0) { @@ -2977,6 +2983,7 @@ next_argv() prep_path(current_file, fn); } if (binmode) rb_io_binmode(current_file); + if (defout_binmode) rb_io_binmode(rb_defout); } else { init_p = 0; |