summaryrefslogtreecommitdiff
path: root/ext/iconv
diff options
context:
space:
mode:
Diffstat (limited to 'ext/iconv')
-rw-r--r--ext/iconv/charset_alias.rb3
-rw-r--r--ext/iconv/iconv.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/ext/iconv/charset_alias.rb b/ext/iconv/charset_alias.rb
index 48f0fae5f9..62742e62a8 100644
--- a/ext/iconv/charset_alias.rb
+++ b/ext/iconv/charset_alias.rb
@@ -14,8 +14,7 @@ def charset_alias(config_charset, mapfile, target = OS)
next comments << list if /^\#/ =~ list
next unless /^(\S+)\s+(\S+)$/ =~ list
sys, can = $1, $2
- next if sys == can
- next if can.downcase! and sys == can
+ can.downcase!
map[can] = sys
end
case target
diff --git a/ext/iconv/iconv.c b/ext/iconv/iconv.c
index 8e978b8730..90bf024afb 100644
--- a/ext/iconv/iconv.c
+++ b/ext/iconv/iconv.c
@@ -110,9 +110,9 @@ map_charset
VALUE val = *code;
if (RHASH(charset_map)->tbl && RHASH(charset_map)->tbl->num_entries) {
- val = rb_funcall2(val, rb_intern("downcase"), 0, 0);
- StringValuePtr(val);
- if (st_lookup(RHASH(charset_map)->tbl, val, &val)) {
+ 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;
}