aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--encoding.c8
2 files changed, 11 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1473c46475..3284681b9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Wed Jun 13 13:39:04 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * encoding.c (enc_alias_internal): use strdup defined as macro.
+
Wed Jun 13 10:20:27 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (rb_exec_fillarg): get rid of SIZE_T_MAX which may need
diff --git a/encoding.c b/encoding.c
index a0c860625a..38e28c837d 100644
--- a/encoding.c
+++ b/encoding.c
@@ -461,6 +461,12 @@ rb_enc_unicode_p(rb_encoding *enc)
return name[0] == 'U' && name[1] == 'T' && name[2] == 'F' && name[4] != '7';
}
+static st_data_t
+enc_dup_name(st_data_t name)
+{
+ return (st_data_t)strdup((const char *)name);
+}
+
/*
* Returns copied alias name when the key is added for st_table,
* else returns NULL.
@@ -469,7 +475,7 @@ static int
enc_alias_internal(const char *alias, int idx)
{
return st_insert2(enc_table.names, (st_data_t)alias, (st_data_t)idx,
- (st_data_t(*)(st_data_t))strdup);
+ enc_dup_name);
}
static int