summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-12 09:24:28 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-12 09:24:28 +0000
commit7af9f795609db767ee6bc9f3862a87f6a6a6f8f6 (patch)
tree29002e7493ec7f910e1fb09956c26e48b9c0002c /io.c
parent81dded0d178d0c6d9b251da5a1ee132f2e1449b4 (diff)
* io.c (next_argv): inherit binmode from $defout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 737776d..7381fe1 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;