diff options
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; |