summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--ext/iconv/iconv.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index ac0ad5d5a..a5b4623cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Mon Dec 22 21:59:24 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * ext/iconv/iconv.c (map_charset): always ensure code is a String.
+
Mon Dec 22 21:15:29 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* class.c (rb_mod_init_copy): always copy singleton class.
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