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

* transcode.c (econv_opts): don't use to_sym.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2008-09-15 14:38:12 +00:00
parent a517395056
commit e0f064cf3c
2 changed files with 8 additions and 2 deletions

View file

@ -1,3 +1,7 @@
Mon Sep 15 23:37:15 2008 Tanaka Akira <akr@fsij.org>
* transcode.c (econv_opts): don't use to_sym.
Mon Sep 15 23:28:28 2008 Tanaka Akira <akr@fsij.org>
* encoding.c (rb_enc_get_index): don't return -1.

View file

@ -2287,16 +2287,18 @@ econv_opts(VALUE opt)
v = rb_hash_aref(opt, sym_xml);
if (!NIL_P(v)) {
v = rb_convert_type(v, T_SYMBOL, "Symbol", "to_sym");
if (v==sym_text) {
ecflags |= ECONV_XML_TEXT_DECORATOR|ECONV_UNDEF_HEX_CHARREF;
}
else if (v==sym_attr) {
ecflags |= ECONV_XML_ATTR_CONTENT_DECORATOR|ECONV_XML_ATTR_QUOTE_DECORATOR|ECONV_UNDEF_HEX_CHARREF;
}
else {
else if (TYPE(v) == T_SYMBOL) {
rb_raise(rb_eArgError, "unexpected value for xml option: %s", rb_id2name(SYM2ID(v)));
}
else {
rb_raise(rb_eArgError, "unexpected value for xml option");
}
}
v = rb_hash_aref(opt, sym_universal_newline);