1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* transcode.c (rb_econv_t): new field: started.

(rb_econv_open_by_transcoder_entries): initialize started field.
  (rb_econv_convert): set started field.
  (rb_econv_insert_output): ditto.
  (rb_econv_decorate_at): check started field instead of num_finished.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-09-12 12:23:25 +00:00
parent 290ae0ea85
commit 19438eee8b
2 changed files with 16 additions and 1 deletions

View file

@ -1,3 +1,11 @@
Fri Sep 12 21:22:09 2008 Tanaka Akira <akr@fsij.org>
* transcode.c (rb_econv_t): new field: started.
(rb_econv_open_by_transcoder_entries): initialize started field.
(rb_econv_convert): set started field.
(rb_econv_insert_output): ditto.
(rb_econv_decorate_at): check started field instead of num_finished.
Fri Sep 12 20:28:59 2008 Tanaka Akira <akr@fsij.org>
* regenc.c (onigenc_single_byte_code_to_mbc): follow OnigEncoding

View file

@ -97,6 +97,8 @@ struct rb_econv_t {
const char *source_encoding_name;
const char *destination_encoding_name;
int started;
const unsigned char *replacement_str;
size_t replacement_len;
const char *replacement_enc;
@ -788,6 +790,7 @@ rb_econv_open_by_transcoder_entries(int n, transcoder_entry_t **entries)
ec->flags = 0;
ec->source_encoding_name = NULL;
ec->destination_encoding_name = NULL;
ec->started = 0;
ec->replacement_str = NULL;
ec->replacement_len = 0;
ec->replacement_enc = NULL;
@ -1331,6 +1334,8 @@ rb_econv_convert(rb_econv_t *ec,
unsigned char empty_buf;
unsigned char *empty_ptr = &empty_buf;
ec->started = 1;
if (!input_ptr) {
input_ptr = (const unsigned char **)&empty_ptr;
input_stop = empty_ptr;
@ -1478,6 +1483,8 @@ rb_econv_insert_output(rb_econv_t *ec,
size_t need;
ec->started = 1;
if (len == 0)
return 0;
@ -1729,7 +1736,7 @@ rb_econv_decorate_at(rb_econv_t *ec, const char *decorator_name, int n)
unsigned char *p;
int bufsize = 4096;
if (ec->num_finished != 0)
if (ec->started != 0)
return -1;
entry = get_transcoder_entry("", decorator_name);