From e2d384d628c8e4bd59300844e9111645d1070d5a Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 22 Nov 2002 09:14:24 +0000 Subject: * file.c (rb_find_file_ext): should not terminate searching with empty path, just ignore. * dir.c: remove inclusion. * compar.c (cmp_eq,cmp_gt,cmp_ge,cmp_lt,cmp_le): check using rb_cmpint(). * error.c (init_syserr): remove sys_nerr dependency. * numeric.c (num_cmp): added to satisfy Comparable assumption. * eval.c (rb_add_method): "initialize" should be public if it is a singleton method. * regex.c (re_match): avoid dereferencing if size == 0. (ruby-bugs-ja:PR#360) * time.c (time_cmp): should return nil if an operand is not a number nor time. (ruby-bugs-ja:PR#359) * file.c (rb_stat_cmp): should return nil if an operand is not File::Stat. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- eval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 79cde66aa0..0dd0e207fa 100644 --- a/eval.c +++ b/eval.c @@ -247,7 +247,7 @@ rb_add_method(klass, mid, node, noex) if (ruby_safe_level >= 4 && (klass == rb_cObject || !OBJ_TAINTED(klass))) { rb_raise(rb_eSecurityError, "Insecure: can't define method"); } - if (mid == init) { + if (mid == init && !FL_TEST(klass, FL_SINGLETON) && nd_type(node) != NODE_ZSUPER) { noex = NOEX_PRIVATE | (noex & NOEX_NOSUPER); } if (OBJ_FROZEN(klass)) rb_error_frozen("class/module"); -- cgit v1.2.3