diff options
author | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-15 11:42:51 +0000 |
---|---|---|
committer | ocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-15 11:42:51 +0000 |
commit | b014474223f1e5304e6f1d3861ee5a26b4d62e44 (patch) | |
tree | 27d9106c6726271f2721036fe9f6b1ab59eb8811 /variable.c | |
parent | b12a66055a29a3db3d9e9deda4d0867d0b837ea3 (diff) | |
download | ruby-b014474223f1e5304e6f1d3861ee5a26b4d62e44.tar.gz ruby-b014474223f1e5304e6f1d3861ee5a26b4d62e44.tar.xz ruby-b014474223f1e5304e6f1d3861ee5a26b4d62e44.zip |
* class.c, error.c, eval.c, intern.h, object.c, variable.c:
do not set path if it is a singleton class. [ruby-dev:22588]
(backport from 1.9)
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'variable.c')
-rw-r--r-- | variable.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/variable.c b/variable.c index 17832df8e..e97eef0f7 100644 --- a/variable.c +++ b/variable.c @@ -146,7 +146,6 @@ classname(klass) { VALUE path = Qnil; - klass = rb_class_real(klass); if (!klass) klass = rb_cObject; if (ROBJECT(klass)->iv_tbl) { if (!st_lookup(ROBJECT(klass)->iv_tbl, classpath, &path)) { @@ -281,11 +280,18 @@ rb_name_class(klass, id) rb_iv_set(klass, "__classid__", ID2SYM(id)); } +VALUE +rb_class_name(klass) + VALUE klass; +{ + return rb_class_path(rb_class_real(klass)); +} + char * rb_class2name(klass) VALUE klass; { - return RSTRING(rb_class_path(klass))->ptr; + return RSTRING(rb_class_name(klass))->ptr; } char * @@ -1193,7 +1199,7 @@ uninitialized_constant(klass, id) { if (klass && klass != rb_cObject) rb_name_error(id, "uninitialized constant %s::%s", - RSTRING(rb_class_path(klass))->ptr, + rb_class2name(klass), rb_id2name(id)); else { rb_name_error(id, "uninitialized constant %s", rb_id2name(id)); |