diff options
-rw-r--r-- | COPYING | 4 | ||||
-rw-r--r-- | ChangeLog | 16 | ||||
-rw-r--r-- | eval.c | 31 | ||||
-rw-r--r-- | hash.c | 8 | ||||
-rw-r--r-- | object.c | 10 | ||||
-rw-r--r-- | process.c | 21 |
6 files changed, 63 insertions, 27 deletions
@@ -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. @@ -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; @@ -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 |