* eval.c (method_inspect): should not dump core for unbound

singleton methods.

* object.c (rb_mod_to_s): better description.

* hash.c (env_select): should path the assoc list.

* process.c (rb_syswait): thread kludge; should be fixed to
  support native thread.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2002-02-25 09:16:25 +00:00
Родитель aaa30fd040
Коммит 6d47b8a9cc
6 изменённых файлов: 63 добавлений и 27 удалений

Просмотреть файл

@ -17,8 +17,8 @@ You can redistribute it and/or modify it under either the terms of the GPL
b) use the modified software only within your corporation or
organization.
c) rename any non-standard binaries so the names do not conflict
with standard binaries, which must also be provided.
c) give non-standard binaries non-standard names, with
instructions on where to get the original software distribution.
d) make other distribution arrangements with the author.

Просмотреть файл

@ -1,12 +1,28 @@
Mon Feb 25 15:14:01 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (method_inspect): should not dump core for unbound
singleton methods.
* object.c (rb_mod_to_s): better description.
Mon Feb 25 13:32:13 2002 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
* lib/shell.rb (Shell::expand_path): relative to @cwd.
Mon Feb 25 06:30:11 2002 Koji Arai <jca02266@nifty.ne.jp>
* hash.c (env_select): should path the assoc list.
Sun Feb 24 17:20:22 2002 Akinori MUSHA <knu@iDaemons.org>
* ext/digest/*/*.h: Merge from rough.
- Avoid namespace pollution. (MD5_* -> rb_Digest_MD5_*, etc.)
Sat Feb 23 21:12:13 2002 Yukihiro Matsumoto <matz@ruby-lang.org>
* process.c (rb_syswait): thread kludge; should be fixed to
support native thread.
Fri Feb 22 21:20:53 2002 Minero Aoki <aamine@loveruby.net>
* lib/net/protocol.rb: set read_timeout dynamically.

31
eval.c
Просмотреть файл

@ -6941,28 +6941,33 @@ method_inspect(method)
rb_str_buf_cat2(str, ": ");
if (FL_TEST(data->klass, FL_SINGLETON)) {
VALUE v;
VALUE v = rb_iv_get(data->klass, "__attached__");
rb_str_buf_append(str, rb_inspect(data->recv));
v = rb_iv_get(data->klass, "__attached__");
if (data->recv != v) {
rb_str_buf_cat2(str, "(");
if (data->recv == Qundef) {
rb_str_buf_append(str, rb_inspect(data->klass));
}
else if (data->recv == v) {
rb_str_buf_append(str, rb_inspect(v));
rb_str_buf_cat2(str, ").");
sharp = ".";
}
else {
rb_str_buf_cat2(str, ".");
rb_str_buf_append(str, rb_inspect(data->recv));
rb_str_buf_cat2(str, "(");
rb_str_buf_append(str, rb_inspect(v));
rb_str_buf_cat2(str, ")");
sharp = ".";
}
}
else {
rb_str_buf_cat2(str, rb_class2name(data->rklass));
rb_str_buf_cat2(str, "(");
s = rb_class2name(data->klass);
rb_str_buf_cat2(str, s);
rb_str_buf_cat2(str, ")#");
if (data->rklass != data->klass) {
rb_str_buf_cat2(str, "(");
rb_str_buf_cat2(str, rb_class2name(data->klass));
rb_str_buf_cat2(str, ")");
}
}
s = rb_id2name(data->oid);
rb_str_buf_cat2(str, s);
rb_str_buf_cat2(str, sharp);
rb_str_buf_cat2(str, rb_id2name(data->oid));
rb_str_buf_cat2(str, ">");
return str;

8
hash.c
Просмотреть файл

@ -1327,10 +1327,10 @@ env_select(argc, argv)
while (*env) {
char *s = strchr(*env, '=');
if (s) {
VALUE str = rb_tainted_str_new(*env, s-*env);
if (RTEST(rb_yield(str))) {
rb_ary_push(result, str);
VALUE assoc = rb_assoc_new(rb_tainted_str_new(*env, s-*env),
rb_tainted_str_new2(s+1));
if (RTEST(rb_yield(assoc))) {
rb_ary_push(result, assoc);
}
}
env++;

Просмотреть файл

@ -500,9 +500,17 @@ rb_mod_to_s(klass)
{
if (FL_TEST(klass, FL_SINGLETON)) {
VALUE s = rb_str_new2("#<");
VALUE v = rb_iv_get(klass, "__attached__");
rb_str_cat2(s, "Class:");
rb_str_cat2(s, rb_class2name(klass));
switch (TYPE(v)) {
case T_CLASS: case T_MODULE:
rb_str_append(s, rb_inspect(v));
break;
default:
rb_str_append(s, rb_any_to_s(v));
break;
}
rb_str_cat2(s, ">");
return s;

Просмотреть файл

@ -768,29 +768,36 @@ void
rb_syswait(pid)
int pid;
{
static int overriding;
RETSIGTYPE (*hfunc)_((int)), (*qfunc)_((int)), (*ifunc)_((int));
int status;
int i;
int i, hooked = Qfalse;
if (!overriding) {
#ifdef SIGHUP
hfunc = signal(SIGHUP, SIG_IGN);
hfunc = signal(SIGHUP, SIG_IGN);
#endif
#ifdef SIGQUIT
qfunc = signal(SIGQUIT, SIG_IGN);
qfunc = signal(SIGQUIT, SIG_IGN);
#endif
ifunc = signal(SIGINT, SIG_IGN);
ifunc = signal(SIGINT, SIG_IGN);
overriding = Qtrue;
hooked = Qtrue;
}
do {
i = rb_waitpid(pid, &status, 0);
} while (i == -1 && errno == EINTR);
if (hooked) {
#ifdef SIGHUP
signal(SIGHUP, hfunc);
signal(SIGHUP, hfunc);
#endif
#ifdef SIGQUIT
signal(SIGQUIT, qfunc);
signal(SIGQUIT, qfunc);
#endif
signal(SIGINT, ifunc);
signal(SIGINT, ifunc);
}
}
static VALUE