summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-02 15:20:24 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-02 15:20:24 +0000
commit5348a9d072edc296c4cb5f66748df2274c119387 (patch)
treeb535d0fa5be1cd7445a7374bca7a0922abcc7b26 /struct.c
parent580b004abe25e979e875a99189167b69eb81e09b (diff)
downloadruby-5348a9d072edc296c4cb5f66748df2274c119387.tar.gz
ruby-5348a9d072edc296c4cb5f66748df2274c119387.tar.xz
ruby-5348a9d072edc296c4cb5f66748df2274c119387.zip
* string.c (Init_String): undef Symbol#new.
* struct.c (rb_struct_s_def): wrong symbol detection. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10837 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/struct.c b/struct.c
index b93f3383e..cc09b093e 100644
--- a/struct.c
+++ b/struct.c
@@ -282,14 +282,9 @@ rb_struct_s_def(int argc, VALUE *argv, VALUE klass)
id = rb_to_id(RARRAY_PTR(rest)[i]);
RARRAY_PTR(rest)[i] = ID2SYM(id);
}
- if (!NIL_P(name)) {
- VALUE tmp = rb_check_string_type(name);
-
- if (NIL_P(tmp)) {
- id = rb_to_id(name);
- rb_ary_unshift(rest, ID2SYM(id));
- name = Qnil;
- }
+ if (!NIL_P(name) && SYMBOL_P(name)) {
+ rb_ary_unshift(rest, name);
+ name = Qnil;
}
st = make_struct(name, rest, klass);
if (rb_block_given_p()) {