ruby-changes:9502
From: yugui <ko1@a...>
Date: Thu, 25 Dec 2008 19:14:51 +0900 (JST)
Subject: [ruby-changes:9502] Ruby:r21042 (ruby_1_9_1): merges r20991 from trunk into ruby_1_9_1.
yugui 2008-12-25 18:58:27 +0900 (Thu, 25 Dec 2008) New Revision: 21042 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=21042 Log: merges r20991 from trunk into ruby_1_9_1. * transcode.c (decorate_convpath): show type of escaping for xml_attr_quote or some conversions. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/transcode.c Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 21041) +++ ruby_1_9_1/ChangeLog (revision 21042) @@ -1,3 +1,8 @@ +Thu Dec 25 17:49:45 2008 NARUSE, Yui <naruse@r...> + + * transcode.c (decorate_convpath): show type of escaping for + xml_attr_quote or some conversions. + Thu Dec 25 17:06:13 2008 Tanaka Akira <akr@f...> * io.c (rb_io_initialize): check fd validity. [ruby-dev:36646] Index: ruby_1_9_1/transcode.c =================================================================== --- ruby_1_9_1/transcode.c (revision 21041) +++ ruby_1_9_1/transcode.c (revision 21042) @@ -2772,17 +2772,22 @@ len = n = RARRAY_LEN(convpath); if (n != 0) { VALUE pair = RARRAY_PTR(convpath)[n-1]; - const char *sname = rb_enc_name(rb_to_encoding(RARRAY_PTR(pair)[0])); - const char *dname = rb_enc_name(rb_to_encoding(RARRAY_PTR(pair)[1])); - transcoder_entry_t *entry = get_transcoder_entry(sname, dname); - const rb_transcoder *tr = load_transcoder_entry(entry); - if (!tr) - return -1; - if (!DECORATOR_P(tr->src_encoding, tr->dst_encoding) && - tr->asciicompat_type == asciicompat_encoder) { - n--; - rb_ary_store(convpath, len + num_decorators - 1, pair); - } + if (TYPE(pair) == T_ARRAY) { + const char *sname = rb_enc_name(rb_to_encoding(RARRAY_PTR(pair)[0])); + const char *dname = rb_enc_name(rb_to_encoding(RARRAY_PTR(pair)[1])); + transcoder_entry_t *entry = get_transcoder_entry(sname, dname); + const rb_transcoder *tr = load_transcoder_entry(entry); + if (!tr) + return -1; + if (!DECORATOR_P(tr->src_encoding, tr->dst_encoding) && + tr->asciicompat_type == asciicompat_encoder) { + n--; + rb_ary_store(convpath, len + num_decorators - 1, pair); + } + } + else { + rb_ary_store(convpath, len + num_decorators - 1, pair); + } } for (i = 0; i < num_decorators; i++) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/