summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--COPYING4
-rw-r--r--ChangeLog16
-rw-r--r--eval.c31
-rw-r--r--hash.c8
-rw-r--r--object.c10
-rw-r--r--process.c21
6 files changed, 63 insertions, 27 deletions
diff --git a/COPYING b/COPYING
index 42c8775631..870a5f22d6 100644
--- a/COPYING
+++ b/COPYING
@@ -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.
diff --git a/ChangeLog b/ChangeLog
index 5734fbce21..6792384973 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/eval.c b/eval.c
index fef1c86809..e6bcdc859e 100644
--- a/eval.c
+++ b/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;
diff --git a/hash.c b/hash.c
index dda50abe12..468830a075 100644
--- a/hash.c
+++ b/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++;
diff --git a/object.c b/object.c
index 240a51c3f9..bf22075369 100644
--- a/object.c
+++ b/object.c
@@ -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;
diff --git a/process.c b/process.c
index 8da5953573..7f1375dd32 100644
--- a/process.c
+++ b/process.c
@@ -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