aboutsummaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/io.c b/io.c
index 737776d915..7381fe1c92 100644
--- a/io.c
+++ b/io.c
@@ -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;