aboutsummaryrefslogtreecommitdiffstats
path: root/transcode.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-26 12:45:20 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-26 12:45:20 +0000
commit18b097b73b49965bed5e37c6f53b2043e50103c8 (patch)
tree79858c355767eee8c135c1008efa70c9baa1e957 /transcode.c
parent2e248635499284b5dfd63e33e81c2c3dafe405cc (diff)
downloadruby-18b097b73b49965bed5e37c6f53b2043e50103c8.tar.gz
* transcode.c (rb_econv_binmode): binmode is effective only once.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
-rw-r--r--transcode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/transcode.c b/transcode.c
index 8a57054eb2..108a44b880 100644
--- a/transcode.c
+++ b/transcode.c
@@ -1476,12 +1476,14 @@ rb_econv_binmode(rb_econv_t *ec)
ec->elems[i].out_data_end = NULL;
ec->elems[i].out_buf_end = NULL;
ec->num_trans--;
+ ec->opts.flags &= ~ECONV_UNIVERSAL_NEWLINE_DECODER;
}
if (ec->opts.flags & (ECONV_CRLF_NEWLINE_ENCODER|ECONV_CR_NEWLINE_ENCODER)) {
rb_transcoding_close(ec->elems[0].tc);
xfree(ec->elems[0].out_buf_start);
MEMMOVE(&ec->elems[0], &ec->elems[1], rb_econv_elem_t, ec->num_trans-1);
ec->num_trans--;
+ ec->opts.flags &= ~(ECONV_CRLF_NEWLINE_ENCODER|ECONV_CR_NEWLINE_ENCODER);
}
}