ruby-changes:9453
From: naruse <ko1@a...>
Date: Thu, 25 Dec 2008 17:55:08 +0900 (JST)
Subject: [ruby-changes:9453] Ruby:r20991 (trunk): * transcode.c (decorate_convpath): show type of escaping for
naruse 2008-12-25 17:54:51 +0900 (Thu, 25 Dec 2008) New Revision: 20991 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=20991 Log: * transcode.c (decorate_convpath): show type of escaping for xml_attr_quote or some conversions. Modified files: trunk/ChangeLog trunk/transcode.c Index: ChangeLog =================================================================== --- ChangeLog (revision 20990) +++ ChangeLog (revision 20991) @@ -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: transcode.c =================================================================== --- transcode.c (revision 20990) +++ transcode.c (revision 20991) @@ -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/