diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-05 15:31:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-03-05 15:31:42 +0000 |
commit | 79cdf2ffa201b3b9f1108d77231a7adae2c4e3bb (patch) | |
tree | cf4f3b7def41d8f798af09d200dd52c180df9908 /struct.c | |
parent | fff981ee6de1c91392105aeef60bd17f2b88af70 (diff) |
* struct.c (make_struct): preserve encoding of struct name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -181,14 +181,12 @@ make_struct(VALUE name, VALUE members, VALUE klass) rb_class_inherited(klass, nstr); } else { - char *cname = StringValuePtr(name); - - id = rb_intern(cname); + id = SYM2ID(rb_str_intern(name)); if (!rb_is_const_id(id)) { - rb_name_error(id, "identifier %s needs to be constant", cname); + rb_name_error(id, "identifier %s needs to be constant", StringValuePtr(name)); } if (rb_const_defined_at(klass, id)) { - rb_warn("redefining constant Struct::%s", cname); + rb_warn("redefining constant Struct::%s", StringValuePtr(name)); rb_mod_remove_const(klass, ID2SYM(id)); } nstr = rb_define_class_under(klass, rb_id2name(id), klass); |