From aef04b63e626ae7cf7d8a8cda6d8ba6f1dda8fd5 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 11 Dec 2003 21:06:14 +0000 Subject: [PATCH] * eval.c (proc_invoke): fix class name in warning message for define_method. [ruby-dev:22235] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5174 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ eval.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d1e500dd1e..2db23ffe90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Dec 12 06:06:09 2003 Nobuyoshi Nakada + + * eval.c (proc_invoke): fix class name in warning message for + define_method. [ruby-dev:22235] + Thu Dec 11 21:24:43 2003 GOTOU Yuuzou * ext/openssl/ossl_pkcs12.[ch]: new files. add OpenSSL::PKCS12. diff --git a/eval.c b/eval.c index 5e88cf5176..a09c753e02 100644 --- a/eval.c +++ b/eval.c @@ -7124,8 +7124,10 @@ proc_invoke(proc, args, self, klass) volatile int pcall, avalue = Qtrue; if (rb_block_given_p() && ruby_frame->last_func) { + if (klass != ruby_frame->last_class) + klass = rb_obj_class(proc); rb_warning("block for %s#%s is useless", - rb_obj_classname(proc), + rb_class2name(klass), rb_id2name(ruby_frame->last_func)); }