mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (rb_mod_modfunc): should follow NODE_ZSUPER link; based
on Guy Decoux's patch in [ruby-talk:25478]. * string.c (rb_str_succ): there was buffer overrun. * parse.y (str_extend): term can be any character. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
df96f994f1
commit
04f27f5e8d
6 changed files with 36 additions and 11 deletions
13
ChangeLog
13
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>
|
Mon Nov 19 04:58:42 2001 Wakou Aoyama <wakou@fsinet.or.jp>
|
||||||
|
|
||||||
* lib/cgi.rb (header): support for Apache. thanks to
|
* lib/cgi.rb (header): support for Apache. thanks to
|
||||||
|
|
6
array.c
6
array.c
|
@ -860,8 +860,10 @@ rb_ary_to_s(ary)
|
||||||
VALUE str, sep;
|
VALUE str, sep;
|
||||||
|
|
||||||
if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
|
if (RARRAY(ary)->len == 0) return rb_str_new(0, 0);
|
||||||
if (!NIL_P(rb_output_fs)) sep = rb_output_fs;
|
sep = rb_output_fs;
|
||||||
else sep = rb_default_rs;
|
#if 1
|
||||||
|
if (NIL_P(rb_output_fs)) sep = rb_default_rs; /* newline */
|
||||||
|
#endif
|
||||||
str = rb_ary_join(ary, sep);
|
str = rb_ary_join(ary, sep);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
14
eval.c
14
eval.c
|
@ -5679,10 +5679,18 @@ rb_mod_modfunc(argc, argv, module)
|
||||||
|
|
||||||
set_method_visibility(module, argc, argv, NOEX_PRIVATE);
|
set_method_visibility(module, argc, argv, NOEX_PRIVATE);
|
||||||
for (i=0; i<argc; i++) {
|
for (i=0; i<argc; i++) {
|
||||||
|
VALUE m = module;
|
||||||
|
|
||||||
id = rb_to_id(argv[i]);
|
id = rb_to_id(argv[i]);
|
||||||
body = search_method(module, id, 0);
|
for (;;) {
|
||||||
if (body == 0 || body->nd_body == 0) {
|
body = search_method(m, id, &m);
|
||||||
rb_bug("undefined method `%s'; can't happen", rb_id2name(id));
|
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_add_method(rb_singleton_class(module), id, body->nd_body, NOEX_PUBLIC);
|
||||||
rb_clear_cache_by_id(id);
|
rb_clear_cache_by_id(id);
|
||||||
|
|
5
gc.c
5
gc.c
|
@ -20,6 +20,11 @@
|
||||||
#include "re.h"
|
#include "re.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <setjmp.h>
|
#include <setjmp.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_SYS_TIME_H
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_RESOURCE_H
|
#ifdef HAVE_SYS_RESOURCE_H
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
|
7
parse.y
7
parse.y
|
@ -4028,19 +4028,16 @@ str_extend(list, term)
|
||||||
break;
|
break;
|
||||||
case '{':
|
case '{':
|
||||||
if (brace != -1) nest++;
|
if (brace != -1) nest++;
|
||||||
case '\"':
|
default:
|
||||||
case '/':
|
|
||||||
case '`':
|
|
||||||
if (c == term) {
|
if (c == term) {
|
||||||
pushback(c);
|
pushback(c);
|
||||||
list_append(list, NEW_STR(rb_str_new2("#")));
|
list_append(list, NEW_STR(rb_str_new2("#")));
|
||||||
rb_warning("bad substitution in string");
|
rb_warn("bad substitution in string");
|
||||||
tokfix();
|
tokfix();
|
||||||
list_append(list, NEW_STR(rb_str_new(tok(), toklen())));
|
list_append(list, NEW_STR(rb_str_new(tok(), toklen())));
|
||||||
newtok();
|
newtok();
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
default:
|
|
||||||
tokadd(c);
|
tokadd(c);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
2
string.c
2
string.c
|
@ -1018,7 +1018,7 @@ rb_str_succ(orig)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (s < sbeg) {
|
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;
|
s = RSTRING(str)->ptr + n;
|
||||||
memmove(s+1, s, RSTRING(str)->len - n);
|
memmove(s+1, s, RSTRING(str)->len - n);
|
||||||
*s = c;
|
*s = c;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue