From e0f064cf3c4f5b59d438e96b5fb002a984b78329 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 15 Sep 2008 14:38:12 +0000 Subject: [PATCH] * 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 --- ChangeLog | 4 ++++ transcode.c | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0eb2e48a4a..ecd83d8a09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Sep 15 23:37:15 2008 Tanaka Akira + + * transcode.c (econv_opts): don't use to_sym. + Mon Sep 15 23:28:28 2008 Tanaka Akira * encoding.c (rb_enc_get_index): don't return -1. diff --git a/transcode.c b/transcode.c index dd75a5e303..e883133428 100644 --- a/transcode.c +++ b/transcode.c @@ -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);