diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-22 12:59:28 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-22 12:59:28 +0000 |
commit | 663e6421bf1d4f2f7b8be573503054e483f2245c (patch) | |
tree | 4537e10981cd95c2542e2128d7cc2beb1ff9b1ed /ext/iconv | |
parent | c12a5acfc2b0a97beaff67513f695555f668a4b9 (diff) | |
download | ruby-663e6421bf1d4f2f7b8be573503054e483f2245c.tar.gz ruby-663e6421bf1d4f2f7b8be573503054e483f2245c.tar.xz ruby-663e6421bf1d4f2f7b8be573503054e483f2245c.zip |
* ext/iconv/iconv.c (map_charset): always ensure code is a String.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/iconv')
-rw-r--r-- | ext/iconv/iconv.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c index 1ef2a51b1..4b1f4b507 100644 --- a/ext/iconv/iconv.c +++ b/ext/iconv/iconv.c @@ -113,14 +113,10 @@ map_charset VALUE key = rb_funcall2(val, rb_intern("downcase"), 0, 0); StringValuePtr(key); if (st_lookup(RHASH(charset_map)->tbl, key, &val)) { - StringValuePtr(val); *code = val; } } - else { - StringValuePtr(val); - } - return RSTRING(val)->ptr; + return StringValuePtr(*code); } static iconv_t |