From 3b37a6847edb2da6225d9785a4579e0cb603dab1 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 3 Oct 2001 07:19:19 +0000 Subject: * marshal.c (r_object): better allocation type check for TYPE_UCLASS. usage of allocation framework is disabled for now. * variable.c (rb_class_path): Module may have subclass. * string.c (rb_str_update): should maintain original negative offset. * string.c (rb_str_subpat_set): ditto * string.c (rb_str_aset): ditto. * re.c (rb_reg_nth_match): should check negative nth. * re.c (rb_reg_nth_defined): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@1764 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- variable.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 28013e76a..a6260d7ea 100644 --- a/variable.c +++ b/variable.c @@ -187,8 +187,13 @@ rb_class_path(klass) char buf[256]; char *s = "Class"; - if (TYPE(klass) == T_MODULE) s = "Module"; - sprintf(buf, "#<%s 0lx%lx>", s, klass); + if (TYPE(klass) == T_MODULE) { + if (rb_obj_class(klass) == rb_cModule) + s = "Module"; + else + s = rb_class2name(RBASIC(klass)->klass); + } + sprintf(buf, "#<%s:0x%lx>", s, klass); return rb_str_new2(buf); } } -- cgit