diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | error.c | 2 | ||||
-rw-r--r-- | object.c | 2 | ||||
-rw-r--r-- | variable.c | 15 |
4 files changed, 10 insertions, 15 deletions
@@ -1,3 +1,9 @@ +Fri Jan 23 14:19:28 1998 Yukihiro Matsumoto <matz@netlab.co.jp> + + * object.c (mod_to_s): need to duplicate classpath. + + * error.c (exc_inspect): need to duplicate classpath. + Thu Jan 22 00:37:47 1998 Yukihiro Matsumoto <matz@netlab.co.jp> * ruby.h (STR2CSTR): new macro to retrieve char*. @@ -254,7 +254,7 @@ exc_inspect(exc) klass = CLASS_OF(exc); if (RSTRING(exc)->len == 0) { - return rb_class_path(klass); + return str_dup(rb_class_path(klass)); } str = str_new2("#<"); @@ -386,7 +386,7 @@ static VALUE mod_to_s(class) VALUE class; { - return rb_class_path(class); + return str_dup(rb_class_path(class)); } static VALUE diff --git a/variable.c b/variable.c index 7511264330..fa3a79516f 100644 --- a/variable.c +++ b/variable.c @@ -131,12 +131,6 @@ classname(klass) } path = rb_iv_get(klass, "__classpath__"); if (NIL_P(path)) { - path = rb_iv_get(klass, "__classid__"); - if (!NIL_P(path)) { - path = str_new2(rb_id2name(FIX2INT(path))); - } - } - if (NIL_P(path)) { path = find_class_path(klass); if (NIL_P(path)) { return 0; @@ -153,7 +147,7 @@ mod_name(mod) { VALUE path = classname(mod); - if (path) return path; + if (path) return str_dup(path); return str_new(0,0); } @@ -209,12 +203,7 @@ rb_name_class(klass, id) { extern VALUE cString; - if (cString) { - rb_iv_set(klass, "__classpath__", str_new2(rb_id2name(id))); - } - else { - rb_iv_set(klass, "__classid__", INT2FIX(id)); - } + rb_iv_set(klass, "__classpath__", str_new2(rb_id2name(id))); } static st_table *autoload_tbl = 0; |