* transcode.c (decorate_convpath): show type of escaping for

xml_attr_quote or some conversions.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20991 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
naruse 2008-12-25 08:54:51 +00:00
parent ea6ac1c45b
commit d42b3e5c88
2 changed files with 21 additions and 11 deletions

View File

@ -1,3 +1,8 @@
Thu Dec 25 17:49:45 2008 NARUSE, Yui <naruse@ruby-lang.org>
* 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@fsij.org>
* io.c (rb_io_initialize): check fd validity. [ruby-dev:36646]

View File

@ -2772,17 +2772,22 @@ decorate_convpath(VALUE convpath, int ecflags)
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++)