diff --git a/ChangeLog b/ChangeLog index 7fb0b71967..c25329d427 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jan 23 14:19:28 1998 Yukihiro Matsumoto + + * 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 * ruby.h (STR2CSTR): new macro to retrieve char*. diff --git a/error.c b/error.c index bdc38ecb55..4c8aea5964 100644 --- a/error.c +++ b/error.c @@ -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("#<"); diff --git a/object.c b/object.c index be551bd82a..b515b45202 100644 --- a/object.c +++ b/object.c @@ -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 @@ -130,12 +130,6 @@ classname(klass) klass = (VALUE)RCLASS(klass)->super; } 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)) { @@ -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;