aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog13
-rw-r--r--array.c6
-rw-r--r--eval.c14
-rw-r--r--gc.c5
-rw-r--r--parse.y7
-rw-r--r--string.c2
6 files changed, 36 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index 63fb65a8e7..6eb1392085 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+Mon Nov 19 17:58:49 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (rb_mod_modfunc): should follow NODE_ZSUPER link; based
+ on Guy Decoux's patch in [ruby-talk:25478].
+
+Mon Nov 19 16:09:33 2001 Tanaka Akira <akr@m17n.org>
+
+ * string.c (rb_str_succ): there was buffer overrun.
+
+Mon Nov 19 14:14:58 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * parse.y (str_extend): term can be any character.
+
Mon Nov 19 04:58:42 2001 Wakou Aoyama <wakou@fsinet.or.jp>
* lib/cgi.rb (header): support for Apache. thanks to
diff --git a/array.c b/array.c
index 9fae8dcc46..9d5dcd768f 100644
--- a/array.c
+++ b/array.c
@@ -860,8 +860,10 @@ rb_ary_to_s(ary)
VALUE str, sep;
if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
- if (!NIL_P(rb_output_fs)) sep = rb_output_fs;
- else sep = rb_default_rs;
+ sep = rb_output_fs;
+#if 1
+ if (NIL_P(rb_output_fs)) sep = rb_default_rs; /* newline */
+#endif
str = rb_ary_join(ary, sep);
return str;
}
diff --git a/eval.c b/eval.c
index e2cf759138..d1b8322495 100644
--- a/eval.c
+++ b/eval.c
@@ -5679,10 +5679,18 @@ rb_mod_modfunc(argc, argv, module)
set_method_visibility(module, argc, argv, NOEX_PRIVATE);
for (i=0; i<argc; i++) {
+ VALUE m = module;
+
id = rb_to_id(argv[i]);
- body = search_method(module, id, 0);
- if (body == 0 || body->nd_body == 0) {
- rb_bug("undefined method `%s'; can't happen", rb_id2name(id));
+ for (;;) {
+ body = search_method(m, id, &m);
+ if (body == 0 || body->nd_body == 0) {
+ rb_bug("undefined method `%s'; can't happen", rb_id2name(id));
+ }
+ if (nd_type(body->nd_body) != NODE_ZSUPER) {
+ break; /* normal case: need not to follow 'super' link */
+ }
+ m = RCLASS(m)->super;
}
rb_add_method(rb_singleton_class(module), id, body->nd_body, NOEX_PUBLIC);
rb_clear_cache_by_id(id);
diff --git a/gc.c b/gc.c
index 90326e2d3a..effb38eccd 100644
--- a/gc.c
+++ b/gc.c
@@ -20,6 +20,11 @@
#include "re.h"
#include <stdio.h>
#include <setjmp.h>
+#include <sys/types.h>
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
#ifdef HAVE_SYS_RESOURCE_H
#include <sys/resource.h>
diff --git a/parse.y b/parse.y
index 0981a4a74b..944df300da 100644
--- a/parse.y
+++ b/parse.y
@@ -4028,19 +4028,16 @@ str_extend(list, term)
break;
case '{':
if (brace != -1) nest++;
- case '\"':
- case '/':
- case '`':
+ default:
if (c == term) {
pushback(c);
list_append(list, NEW_STR(rb_str_new2("#")));
- rb_warning("bad substitution in string");
+ rb_warn("bad substitution in string");
tokfix();
list_append(list, NEW_STR(rb_str_new(tok(), toklen())));
newtok();
return list;
}
- default:
tokadd(c);
break;
}
diff --git a/string.c b/string.c
index 1c45632b7a..1e55148f47 100644
--- a/string.c
+++ b/string.c
@@ -1018,7 +1018,7 @@ rb_str_succ(orig)
}
}
if (s < sbeg) {
- REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len + 1);
+ REALLOC_N(RSTRING(str)->ptr, char, RSTRING(str)->len + 2);
s = RSTRING(str)->ptr + n;
memmove(s+1, s, RSTRING(str)->len - n);
*s = c;