зеркало из https://github.com/github/ruby.git
variable.c: Get rid of fix len buffer in rb_class_path (ruby-core:381)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
b961db7587
Коммит
5c70716bdc
|
@ -1,3 +1,9 @@
|
||||||
|
Wed Aug 28 23:59:15 2002 Michal Rokos <michal@ruby-lang.org>
|
||||||
|
|
||||||
|
* signal.c: remove #ifdef SIGINT for struct signals.
|
||||||
|
|
||||||
|
* variable.c: get rid of fix length buffer in rb_class_path.
|
||||||
|
|
||||||
Wed Aug 28 23:34:32 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
Wed Aug 28 23:34:32 2002 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* io.c (appendline): data was lost when raw mode.
|
* io.c (appendline): data was lost when raw mode.
|
||||||
|
|
2
signal.c
2
signal.c
|
@ -36,9 +36,7 @@ static struct signals {
|
||||||
#ifdef SIGHUP
|
#ifdef SIGHUP
|
||||||
{"HUP", SIGHUP},
|
{"HUP", SIGHUP},
|
||||||
#endif
|
#endif
|
||||||
#ifdef SIGINT
|
|
||||||
{"INT", SIGINT},
|
{"INT", SIGINT},
|
||||||
#endif
|
|
||||||
#ifdef SIGQUIT
|
#ifdef SIGQUIT
|
||||||
{"QUIT", SIGQUIT},
|
{"QUIT", SIGQUIT},
|
||||||
#endif
|
#endif
|
||||||
|
|
15
variable.c
15
variable.c
|
@ -188,17 +188,22 @@ rb_class_path(klass)
|
||||||
|
|
||||||
if (path) return path;
|
if (path) return path;
|
||||||
else {
|
else {
|
||||||
char buf[256];
|
VALUE str;
|
||||||
char *s = "Class";
|
char *s = "Class";
|
||||||
|
|
||||||
if (TYPE(klass) == T_MODULE) {
|
if (TYPE(klass) == T_MODULE) {
|
||||||
if (rb_obj_class(klass) == rb_cModule)
|
if (rb_obj_class(klass) == rb_cModule) {
|
||||||
s = "Module";
|
s = "Module";
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
s = rb_class2name(RBASIC(klass)->klass);
|
s = rb_class2name(RBASIC(klass)->klass);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
sprintf(buf, "#<%s:0x%lx>", s, klass);
|
str = rb_str_new(0, 2 + strlen(s) + 3 + 2 * SIZEOF_LONG + 1);
|
||||||
return rb_str_new2(buf);
|
sprintf(RSTRING(str)->ptr, "#<%s:0x%lx>", s, klass);
|
||||||
|
RSTRING(str)->len = strlen(RSTRING(str)->ptr);
|
||||||
|
|
||||||
|
return str;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче