* transcode.c (rb_econv_open): fix last_tc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-09-06 10:54:59 +00:00
Родитель 683eec7a5d
Коммит f88c9f03f7
2 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,7 @@
Sat Sep 6 19:54:25 2008 Tanaka Akira <akr@fsij.org>
* transcode.c (rb_econv_open): fix last_tc.
Sat Sep 6 19:36:34 2008 Tanaka Akira <akr@fsij.org>
* io.c (rb_io_binmode): clear newline flags in writeconv_pre_ecflags.

Просмотреть файл

@ -880,7 +880,6 @@ rb_econv_open(const char *sname, const char *dname, int ecflags)
transcoder_entry_t **entries = NULL;
int num_trans;
static rb_econv_t *ec;
int universal_newline_decoder_added = 0;
rb_encoding *senc, *denc;
int sidx, didx;
@ -977,9 +976,9 @@ rb_econv_open(const char *sname, const char *dname, int ecflags)
ec->last_tc = NULL;
ec->last_trans_index = -1;
}
else if (universal_newline_decoder_added) {
ec->last_tc = ec->elems[ec->num_trans-2].tc;
ec->last_trans_index = ec->num_trans-2;
else {
ec->last_trans_index = ec->num_trans-1-num_decoders;
ec->last_tc = ec->elems[ec->last_trans_index].tc;
}
return ec;