mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ef45458e94
commit
1ce6f065b5
16 changed files with 113 additions and 74 deletions
28
ChangeLog
28
ChangeLog
|
@ -1,9 +1,37 @@
|
||||||
|
Tue Oct 10 09:49:23 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* file.c (Init_File): FileTest.size should return 0 (not nil) for
|
||||||
|
empty files.
|
||||||
|
|
||||||
|
Sun Oct 8 13:20:26 2000 Guy Decoux <decoux@moulon.inra.fr>
|
||||||
|
|
||||||
|
* eval.c (POP_SCOPE): not just set SCOPE_DONT_RECYCLE, but do
|
||||||
|
scope_dup().
|
||||||
|
|
||||||
|
Sat Oct 7 15:10:50 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* string.c (rb_str_reverse_bang): unnecessary ALLOCA_N() was
|
||||||
|
removed.
|
||||||
|
|
||||||
Fri Oct 6 14:50:24 2000 WATANABE Hirofumi <eban@ruby-lang.org>
|
Fri Oct 6 14:50:24 2000 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||||
|
|
||||||
* ext/extmk.rb.in, lib/mkmf.rb: remove "DESTDIR =".
|
* ext/extmk.rb.in, lib/mkmf.rb: remove "DESTDIR =".
|
||||||
|
|
||||||
* Makefile.in, win32/Makefile.sub, ruby.1: renamed -X to -C.
|
* Makefile.in, win32/Makefile.sub, ruby.1: renamed -X to -C.
|
||||||
|
|
||||||
|
Fri Oct 6 12:50:52 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* array.c (rb_ary_plus): use to_ary(), not Check_Type().
|
||||||
|
|
||||||
|
* array.c (rb_ary_concat): ditto.
|
||||||
|
|
||||||
|
* gc.c (rb_gc): use __builtin_frame_address() for gcc.
|
||||||
|
|
||||||
|
* eval.c (stack_length): ditto.
|
||||||
|
|
||||||
|
* parse.y (assign_in_cond): stop warning till some better warning
|
||||||
|
condition will be found.
|
||||||
|
|
||||||
Thu Oct 5 18:02:39 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Thu Oct 5 18:02:39 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
* object.c (rb_obj_dup): should have propagated taint flag.
|
* object.c (rb_obj_dup): should have propagated taint flag.
|
||||||
|
|
18
array.c
18
array.c
|
@ -278,6 +278,9 @@ rb_ary_push_m(argc, argv, ary)
|
||||||
VALUE *argv;
|
VALUE *argv;
|
||||||
VALUE ary;
|
VALUE ary;
|
||||||
{
|
{
|
||||||
|
if (argc == 0) {
|
||||||
|
rb_raise(rb_eArgError, "wrong # of arguments(at least 1)");
|
||||||
|
}
|
||||||
if (argc > 0) {
|
if (argc > 0) {
|
||||||
long len = RARRAY(ary)->len;
|
long len = RARRAY(ary)->len;
|
||||||
|
|
||||||
|
@ -903,9 +906,8 @@ rb_ary_reverse(ary)
|
||||||
|
|
||||||
while (p1 < p2) {
|
while (p1 < p2) {
|
||||||
tmp = *p1;
|
tmp = *p1;
|
||||||
*p1 = *p2;
|
*p1++ = *p2;
|
||||||
*p2 = tmp;
|
*p2-- = tmp;
|
||||||
p1++; p2--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ary;
|
return ary;
|
||||||
|
@ -1236,8 +1238,7 @@ rb_ary_plus(x, y)
|
||||||
{
|
{
|
||||||
VALUE z;
|
VALUE z;
|
||||||
|
|
||||||
Check_Type(y, T_ARRAY);
|
y = to_ary(y);
|
||||||
|
|
||||||
z = rb_ary_new2(RARRAY(x)->len + RARRAY(y)->len);
|
z = rb_ary_new2(RARRAY(x)->len + RARRAY(y)->len);
|
||||||
MEMCPY(RARRAY(z)->ptr, RARRAY(x)->ptr, VALUE, RARRAY(x)->len);
|
MEMCPY(RARRAY(z)->ptr, RARRAY(x)->ptr, VALUE, RARRAY(x)->len);
|
||||||
MEMCPY(RARRAY(z)->ptr+RARRAY(x)->len, RARRAY(y)->ptr, VALUE, RARRAY(y)->len);
|
MEMCPY(RARRAY(z)->ptr+RARRAY(x)->len, RARRAY(y)->ptr, VALUE, RARRAY(y)->len);
|
||||||
|
@ -1249,9 +1250,10 @@ VALUE
|
||||||
rb_ary_concat(x, y)
|
rb_ary_concat(x, y)
|
||||||
VALUE x, y;
|
VALUE x, y;
|
||||||
{
|
{
|
||||||
Check_Type(y, T_ARRAY);
|
y = to_ary(y);
|
||||||
|
if (RARRAY(y)->len > 0) {
|
||||||
rb_ary_push_m(RARRAY(y)->len, RARRAY(y)->ptr, x);
|
rb_ary_push_m(RARRAY(y)->len, RARRAY(y)->ptr, x);
|
||||||
|
}
|
||||||
return x;
|
return x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
21
eval.c
21
eval.c
|
@ -796,10 +796,12 @@ static VALUE ruby_wrapper; /* security wrapper */
|
||||||
|
|
||||||
typedef struct thread * rb_thread_t;
|
typedef struct thread * rb_thread_t;
|
||||||
static rb_thread_t curr_thread = 0;
|
static rb_thread_t curr_thread = 0;
|
||||||
|
static void scope_dup _((struct SCOPE *));
|
||||||
|
|
||||||
#define POP_SCOPE() \
|
#define POP_SCOPE() \
|
||||||
if (ruby_scope->flag & SCOPE_DONT_RECYCLE) {\
|
if (ruby_scope->flag & SCOPE_DONT_RECYCLE) {\
|
||||||
if (_old) _old->flag |= SCOPE_DONT_RECYCLE;\
|
if (_old)\
|
||||||
|
scope_dup(_old);\
|
||||||
} \
|
} \
|
||||||
if (!(ruby_scope->flag & SCOPE_MALLOC)) {\
|
if (!(ruby_scope->flag & SCOPE_MALLOC)) {\
|
||||||
ruby_scope->local_vars = 0; \
|
ruby_scope->local_vars = 0; \
|
||||||
|
@ -1259,7 +1261,7 @@ rb_eval_cmd(cmd, arg)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ruby_scope->flag & SCOPE_DONT_RECYCLE)
|
if (ruby_scope->flag & SCOPE_DONT_RECYCLE)
|
||||||
saved_scope->flag |= SCOPE_DONT_RECYCLE;
|
scope_dup(saved_scope);
|
||||||
ruby_scope = saved_scope;
|
ruby_scope = saved_scope;
|
||||||
ruby_safe_level = safe;
|
ruby_safe_level = safe;
|
||||||
POP_TAG();
|
POP_TAG();
|
||||||
|
@ -3499,7 +3501,7 @@ rb_yield_0(val, self, klass, acheck)
|
||||||
ruby_block = block;
|
ruby_block = block;
|
||||||
ruby_frame = ruby_frame->prev;
|
ruby_frame = ruby_frame->prev;
|
||||||
if (ruby_scope->flag & SCOPE_DONT_RECYCLE)
|
if (ruby_scope->flag & SCOPE_DONT_RECYCLE)
|
||||||
old_scope->flag |= SCOPE_DONT_RECYCLE;
|
scope_dup(old_scope);
|
||||||
ruby_scope = old_scope;
|
ruby_scope = old_scope;
|
||||||
if (state) JUMP_TAG(state);
|
if (state) JUMP_TAG(state);
|
||||||
return result;
|
return result;
|
||||||
|
@ -3994,7 +3996,11 @@ stack_length(p)
|
||||||
alloca(0);
|
alloca(0);
|
||||||
# define STACK_END (&stack_end)
|
# define STACK_END (&stack_end)
|
||||||
#else
|
#else
|
||||||
|
# if defined(__GNUC__)
|
||||||
|
VALUE *stack_end = __builtin_frame_address(0);
|
||||||
|
# else
|
||||||
VALUE *stack_end = alloca(1);
|
VALUE *stack_end = alloca(1);
|
||||||
|
# endif
|
||||||
# define STACK_END (stack_end)
|
# define STACK_END (stack_end)
|
||||||
#endif
|
#endif
|
||||||
if (p) *p = STACK_END;
|
if (p) *p = STACK_END;
|
||||||
|
@ -4659,7 +4665,7 @@ eval(self, src, scope, file, line)
|
||||||
if (!NIL_P(scope)) {
|
if (!NIL_P(scope)) {
|
||||||
ruby_frame = frame.tmp;
|
ruby_frame = frame.tmp;
|
||||||
if (ruby_scope->flag & SCOPE_DONT_RECYCLE)
|
if (ruby_scope->flag & SCOPE_DONT_RECYCLE)
|
||||||
old_scope->flag |= SCOPE_DONT_RECYCLE;
|
scope_dup(old_scope);
|
||||||
ruby_scope = old_scope;
|
ruby_scope = old_scope;
|
||||||
ruby_block = old_block;
|
ruby_block = old_block;
|
||||||
ruby_dyna_vars = old_d_vars;
|
ruby_dyna_vars = old_d_vars;
|
||||||
|
@ -8164,9 +8170,8 @@ rb_thread_inspect(thread)
|
||||||
default:
|
default:
|
||||||
status = "unknown"; break;
|
status = "unknown"; break;
|
||||||
}
|
}
|
||||||
s = ALLOCA_N(char, strlen(cname)+6+16+9+1); /* 6:tags 16:addr 9:status 1:nul */
|
str = rb_str_new(0, strlen(cname)+6+16+9+1); /* 6:tags 16:addr 9:status 1:nul */
|
||||||
sprintf(s, "#<%s:0x%lx %s>", cname, thread, status);
|
sprintf(RSTRING(str)->ptr, "#<%s:0x%lx %s>", cname, thread, status);
|
||||||
str = rb_str_new2(s);
|
|
||||||
OBJ_INFECT(str, thread);
|
OBJ_INFECT(str, thread);
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
|
@ -8187,7 +8192,7 @@ rb_callcc(self)
|
||||||
cont = Data_Wrap_Struct(rb_cCont, thread_mark,
|
cont = Data_Wrap_Struct(rb_cCont, thread_mark,
|
||||||
thread_free, th);
|
thread_free, th);
|
||||||
|
|
||||||
ruby_scope->flag |= SCOPE_DONT_RECYCLE;
|
scope_dup(ruby_scope);
|
||||||
for (tag=prot_tag; tag; tag=tag->prev) {
|
for (tag=prot_tag; tag; tag=tag->prev) {
|
||||||
scope_dup(tag->scope);
|
scope_dup(tag->scope);
|
||||||
}
|
}
|
||||||
|
|
3
file.c
3
file.c
|
@ -2172,7 +2172,7 @@ Init_File()
|
||||||
define_filetest_function("file?", test_f, 1);
|
define_filetest_function("file?", test_f, 1);
|
||||||
define_filetest_function("zero?", test_z, 1);
|
define_filetest_function("zero?", test_z, 1);
|
||||||
define_filetest_function("size?", test_s, 1);
|
define_filetest_function("size?", test_s, 1);
|
||||||
define_filetest_function("size", test_s, 1);
|
define_filetest_function("size", rb_file_s_size, 1);
|
||||||
define_filetest_function("owned?", test_owned, 1);
|
define_filetest_function("owned?", test_owned, 1);
|
||||||
define_filetest_function("grpowned?", test_grpowned, 1);
|
define_filetest_function("grpowned?", test_grpowned, 1);
|
||||||
|
|
||||||
|
@ -2194,7 +2194,6 @@ Init_File()
|
||||||
rb_define_singleton_method(rb_cFile, "atime", rb_file_s_atime, 1);
|
rb_define_singleton_method(rb_cFile, "atime", rb_file_s_atime, 1);
|
||||||
rb_define_singleton_method(rb_cFile, "mtime", rb_file_s_mtime, 1);
|
rb_define_singleton_method(rb_cFile, "mtime", rb_file_s_mtime, 1);
|
||||||
rb_define_singleton_method(rb_cFile, "ctime", rb_file_s_ctime, 1);
|
rb_define_singleton_method(rb_cFile, "ctime", rb_file_s_ctime, 1);
|
||||||
rb_define_singleton_method(rb_cFile, "size", rb_file_s_size, 1);
|
|
||||||
|
|
||||||
rb_define_singleton_method(rb_cFile, "utime", rb_file_s_utime, -1);
|
rb_define_singleton_method(rb_cFile, "utime", rb_file_s_utime, -1);
|
||||||
rb_define_singleton_method(rb_cFile, "chmod", rb_file_s_chmod, -1);
|
rb_define_singleton_method(rb_cFile, "chmod", rb_file_s_chmod, -1);
|
||||||
|
|
8
gc.c
8
gc.c
|
@ -905,7 +905,11 @@ rb_gc()
|
||||||
alloca(0);
|
alloca(0);
|
||||||
# define STACK_END (&stack_end)
|
# define STACK_END (&stack_end)
|
||||||
#else
|
#else
|
||||||
|
# if defined(__GNUC__)
|
||||||
|
VALUE *stack_end = __builtin_frame_address(0);
|
||||||
|
# else
|
||||||
VALUE *stack_end = alloca(1);
|
VALUE *stack_end = alloca(1);
|
||||||
|
# endif
|
||||||
# define STACK_END (stack_end)
|
# define STACK_END (stack_end)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -978,9 +982,11 @@ void
|
||||||
Init_stack(addr)
|
Init_stack(addr)
|
||||||
VALUE *addr;
|
VALUE *addr;
|
||||||
{
|
{
|
||||||
#ifdef __human68k__
|
#if defined(__human68k__)
|
||||||
extern void *_SEND;
|
extern void *_SEND;
|
||||||
rb_gc_stack_start = _SEND;
|
rb_gc_stack_start = _SEND;
|
||||||
|
#elsif defined(__GNUC__)
|
||||||
|
rb_gc_stack_start = __builtin_frame_address(2);
|
||||||
#else
|
#else
|
||||||
VALUE start;
|
VALUE start;
|
||||||
|
|
||||||
|
|
|
@ -258,7 +258,7 @@ class CGI
|
||||||
|
|
||||||
|
|
||||||
=begin
|
=begin
|
||||||
=== ESCAPE HTML &"<>
|
=== ESCAPE HTML &\"<>
|
||||||
CGI::escapeHTML("string")
|
CGI::escapeHTML("string")
|
||||||
=end
|
=end
|
||||||
def CGI::escapeHTML(string)
|
def CGI::escapeHTML(string)
|
||||||
|
|
|
@ -9,7 +9,7 @@ class Mail
|
||||||
@header = {}
|
@header = {}
|
||||||
@body = []
|
@body = []
|
||||||
begin
|
begin
|
||||||
while line = f.gets()
|
f.each do |line|
|
||||||
line.chop!
|
line.chop!
|
||||||
next if /^From /=~line # skip From-line
|
next if /^From /=~line # skip From-line
|
||||||
break if /^$/=~line # end of header
|
break if /^$/=~line # end of header
|
||||||
|
|
|
@ -442,7 +442,6 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(cond
|
(cond
|
||||||
((nth 0 state) ; within string
|
((nth 0 state) ; within string
|
||||||
(setq indent nil)) ; do nothing
|
(setq indent nil)) ; do nothing
|
||||||
|
|
||||||
((car (nth 1 state)) ; in paren
|
((car (nth 1 state)) ; in paren
|
||||||
(goto-char (cdr (nth 1 state)))
|
(goto-char (cdr (nth 1 state)))
|
||||||
(if (eq (car (nth 1 state)) ?\( )
|
(if (eq (car (nth 1 state)) ?\( )
|
||||||
|
@ -463,8 +462,7 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(goto-char parse-start)
|
(goto-char parse-start)
|
||||||
(back-to-indentation)
|
(back-to-indentation)
|
||||||
(setq indent (ruby-indent-size (current-column) (nth 2 state)))))
|
(setq indent (ruby-indent-size (current-column) (nth 2 state)))))
|
||||||
))
|
))
|
||||||
|
|
||||||
((and (nth 2 state)(> (nth 2 state) 0)) ; in nest
|
((and (nth 2 state)(> (nth 2 state) 0)) ; in nest
|
||||||
(if (null (cdr (nth 1 state)))
|
(if (null (cdr (nth 1 state)))
|
||||||
(error "invalid nest"))
|
(error "invalid nest"))
|
||||||
|
@ -485,7 +483,7 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
|
|
||||||
((and (nth 2 state) (< (nth 2 state) 0)) ; in negative nest
|
((and (nth 2 state) (< (nth 2 state) 0)) ; in negative nest
|
||||||
(setq indent (ruby-indent-size (current-column) (nth 2 state)))))
|
(setq indent (ruby-indent-size (current-column) (nth 2 state)))))
|
||||||
|
|
||||||
(cond
|
(cond
|
||||||
(indent
|
(indent
|
||||||
(goto-char indent-point)
|
(goto-char indent-point)
|
||||||
|
@ -514,7 +512,7 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(setq end (point))
|
(setq end (point))
|
||||||
(beginning-of-line)
|
(beginning-of-line)
|
||||||
(if (re-search-forward "^\\s *#" end t)
|
(if (re-search-forward "^\\s *#" end t)
|
||||||
(beginning-of-line)
|
(forward-line 1)
|
||||||
(setq done t))))
|
(setq done t))))
|
||||||
(setq bol (point))
|
(setq bol (point))
|
||||||
(end-of-line)
|
(end-of-line)
|
||||||
|
@ -538,9 +536,10 @@ The variable ruby-indent-level controls the amount of indentation.
|
||||||
(goto-char (match-end 0))
|
(goto-char (match-end 0))
|
||||||
(not (looking-at "[a-z_]"))))
|
(not (looking-at "[a-z_]"))))
|
||||||
(and (looking-at ruby-operator-re)
|
(and (looking-at ruby-operator-re)
|
||||||
|
(not (eq (char-after (1- (point))) ??))
|
||||||
|
(not (eq (char-after (1- (point))) ?$))
|
||||||
(or (not (eq ?/ (char-after (point))))
|
(or (not (eq ?/ (char-after (point))))
|
||||||
(null (nth 0 (ruby-parse-region parse-start (point)))))
|
(null (nth 0 (ruby-parse-region parse-start (point)))))
|
||||||
(not (eq (char-after (1- (point))) ?$))
|
|
||||||
(or (not (eq ?| (char-after (point))))
|
(or (not (eq ?| (char-after (point))))
|
||||||
(save-excursion
|
(save-excursion
|
||||||
(or (eolp) (forward-char -1))
|
(or (eolp) (forward-char -1))
|
||||||
|
|
29
object.c
29
object.c
|
@ -129,13 +129,11 @@ VALUE
|
||||||
rb_any_to_s(obj)
|
rb_any_to_s(obj)
|
||||||
VALUE obj;
|
VALUE obj;
|
||||||
{
|
{
|
||||||
char *s;
|
|
||||||
char *cname = rb_class2name(CLASS_OF(obj));
|
char *cname = rb_class2name(CLASS_OF(obj));
|
||||||
VALUE str;
|
VALUE str;
|
||||||
|
|
||||||
s = ALLOCA_N(char, strlen(cname)+6+16+1); /* 6:tags 16:addr 1:eos */
|
str = rb_str_new(0, strlen(cname)+6+16+1); /* 6:tags 16:addr 1:eos */
|
||||||
sprintf(s, "#<%s:0x%lx>", cname, obj);
|
sprintf(RSTRING(str)->ptr, "#<%s:0x%lx>", cname, obj);
|
||||||
str = rb_str_new2(s);
|
|
||||||
if (OBJ_TAINTED(obj)) OBJ_TAINT(str);
|
if (OBJ_TAINTED(obj)) OBJ_TAINT(str);
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
|
@ -195,17 +193,16 @@ rb_obj_inspect(obj)
|
||||||
&& ROBJECT(obj)->iv_tbl
|
&& ROBJECT(obj)->iv_tbl
|
||||||
&& ROBJECT(obj)->iv_tbl->num_entries > 0) {
|
&& ROBJECT(obj)->iv_tbl->num_entries > 0) {
|
||||||
VALUE str;
|
VALUE str;
|
||||||
char *c, *b;
|
char *c;
|
||||||
|
|
||||||
c = rb_class2name(CLASS_OF(obj));
|
c = rb_class2name(CLASS_OF(obj));
|
||||||
if (rb_inspecting_p(obj)) {
|
if (rb_inspecting_p(obj)) {
|
||||||
b = ALLOCA_N(char, strlen(c)+8+16+1); /* 8:tags 16:addr 1:eos */
|
str = rb_str_new(0, strlen(c)+8+16+1); /* 8:tags 16:addr 1:eos */
|
||||||
sprintf(b, "#<%s:0x%lx ...>", c, obj);
|
sprintf(RSTRING(str)->ptr, "#<%s:0x%lx ...>", c, obj);
|
||||||
return rb_str_new2(b);
|
return str;
|
||||||
}
|
}
|
||||||
b = ALLOCA_N(char, strlen(c)+4+16+1); /* 4:tags 16:addr 1:eos */
|
str = rb_str_new(0, strlen(c)+4+16+1); /* 4:tags 16:addr 1:eos */
|
||||||
sprintf(b, "-<%s:0x%lx ", c, obj);
|
sprintf(RSTRING(str)->ptr, "-<%s:0x%lx ", c, obj);
|
||||||
str = rb_str_new2(b);
|
|
||||||
return rb_protect_inspect(inspect_obj, obj, str);
|
return rb_protect_inspect(inspect_obj, obj, str);
|
||||||
}
|
}
|
||||||
return rb_funcall(obj, rb_intern("to_s"), 0, 0);
|
return rb_funcall(obj, rb_intern("to_s"), 0, 0);
|
||||||
|
@ -495,13 +492,13 @@ static VALUE
|
||||||
sym_inspect(sym)
|
sym_inspect(sym)
|
||||||
VALUE sym;
|
VALUE sym;
|
||||||
{
|
{
|
||||||
char *name, *buf;
|
VALUE str;
|
||||||
|
char *name;
|
||||||
|
|
||||||
|
str = rb_str_new(0, strlen(name)+2);
|
||||||
name = rb_id2name(SYM2ID(sym));
|
name = rb_id2name(SYM2ID(sym));
|
||||||
buf = ALLOCA_N(char, strlen(name)+2);
|
sprintf(RSTRING(str)->ptr, ":%s", name);
|
||||||
sprintf(buf, ":%s", name);
|
return str;
|
||||||
|
|
||||||
return rb_str_new2(buf);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
12
parse.y
12
parse.y
|
@ -4342,11 +4342,6 @@ assign_in_cond(node)
|
||||||
switch (nd_type(node->nd_value)) {
|
switch (nd_type(node->nd_value)) {
|
||||||
case NODE_LIT:
|
case NODE_LIT:
|
||||||
case NODE_STR:
|
case NODE_STR:
|
||||||
case NODE_DSTR:
|
|
||||||
case NODE_XSTR:
|
|
||||||
case NODE_DXSTR:
|
|
||||||
case NODE_EVSTR:
|
|
||||||
case NODE_DREGX:
|
|
||||||
case NODE_NIL:
|
case NODE_NIL:
|
||||||
case NODE_TRUE:
|
case NODE_TRUE:
|
||||||
case NODE_FALSE:
|
case NODE_FALSE:
|
||||||
|
@ -4354,12 +4349,19 @@ assign_in_cond(node)
|
||||||
rb_warn("found = in conditional, should be ==");
|
rb_warn("found = in conditional, should be ==");
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
case NODE_DSTR:
|
||||||
|
case NODE_XSTR:
|
||||||
|
case NODE_DXSTR:
|
||||||
|
case NODE_EVSTR:
|
||||||
|
case NODE_DREGX:
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
#if 0
|
||||||
if (assign_in_cond(node->nd_value) == 0) {
|
if (assign_in_cond(node->nd_value) == 0) {
|
||||||
rb_warning("assignment in condition");
|
rb_warning("assignment in condition");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10
process.c
10
process.c
|
@ -281,7 +281,7 @@ proc_exec_v(argv, prog)
|
||||||
|
|
||||||
for (n = 0; argv[n]; n++)
|
for (n = 0; argv[n]; n++)
|
||||||
/* no-op */;
|
/* no-op */;
|
||||||
new_argv = ALLOCA_N(char *, n + 2);
|
new_argv = ALLOCA_N(char*, n + 2);
|
||||||
for (; n > 0; n--)
|
for (; n > 0; n--)
|
||||||
new_argv[n + 1] = argv[n];
|
new_argv[n + 1] = argv[n];
|
||||||
new_argv[1] = strcpy(ALLOCA_N(char, strlen(argv[0]) + 1), argv[0]);
|
new_argv[1] = strcpy(ALLOCA_N(char, strlen(argv[0]) + 1), argv[0]);
|
||||||
|
@ -409,7 +409,7 @@ proc_spawn_v(argv, prog)
|
||||||
|
|
||||||
for (n = 0; argv[n]; n++)
|
for (n = 0; argv[n]; n++)
|
||||||
/* no-op */;
|
/* no-op */;
|
||||||
new_argv = ALLOCA_N(char *, n + 2);
|
new_argv = ALLOCA_N(char*, n + 2);
|
||||||
for (; n > 0; n--)
|
for (; n > 0; n--)
|
||||||
new_argv[n + 1] = argv[n];
|
new_argv[n + 1] = argv[n];
|
||||||
new_argv[1] = strcpy(ALLOCA_N(char, strlen(argv[0]) + 1), argv[0]);
|
new_argv[1] = strcpy(ALLOCA_N(char, strlen(argv[0]) + 1), argv[0]);
|
||||||
|
@ -439,13 +439,13 @@ proc_spawn_n(argc, argv, prog)
|
||||||
char **args;
|
char **args;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
args = ALLOCA_N(char *, argc + 1);
|
args = ALLOCA_N(char*, argc + 1);
|
||||||
for (i = 0; i < argc; i++) {
|
for (i = 0; i < argc; i++) {
|
||||||
Check_SafeStr(argv[i]);
|
Check_SafeStr(argv[i]);
|
||||||
args[i] = RSTRING(argv[i])->ptr;
|
args[i] = RSTRING(argv[i])->ptr;
|
||||||
}
|
}
|
||||||
Check_SafeStr(prog);
|
Check_SafeStr(prog);
|
||||||
args[i] = (char *) 0;
|
args[i] = (char*) 0;
|
||||||
if (args[0])
|
if (args[0])
|
||||||
return proc_spawn_v(args, RSTRING(prog)->ptr);
|
return proc_spawn_v(args, RSTRING(prog)->ptr);
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -471,7 +471,7 @@ proc_spawn(sv)
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
a = argv = ALLOCA_N(char *, (s - str) / 2 + 2);
|
a = argv = ALLOCA_N(char*, (s - str) / 2 + 2);
|
||||||
s = ALLOCA_N(char, s - str + 1);
|
s = ALLOCA_N(char, s - str + 1);
|
||||||
strcpy(s, str);
|
strcpy(s, str);
|
||||||
if (*a++ = strtok(s, " \t")) {
|
if (*a++ = strtok(s, " \t")) {
|
||||||
|
|
9
re.c
9
re.c
|
@ -1038,7 +1038,7 @@ rb_reg_s_quote(argc, argv)
|
||||||
VALUE str, kcode;
|
VALUE str, kcode;
|
||||||
int kcode_saved = reg_kcode;
|
int kcode_saved = reg_kcode;
|
||||||
char *s, *send, *t;
|
char *s, *send, *t;
|
||||||
char *tmp;
|
VALUE tmp;
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
rb_scan_args(argc, argv, "11", &str, &kcode);
|
rb_scan_args(argc, argv, "11", &str, &kcode);
|
||||||
|
@ -1049,8 +1049,8 @@ rb_reg_s_quote(argc, argv)
|
||||||
}
|
}
|
||||||
s = rb_str2cstr(str, &len);
|
s = rb_str2cstr(str, &len);
|
||||||
send = s + len;
|
send = s + len;
|
||||||
tmp = ALLOCA_N(char, len*2);
|
tmp = rb_str_new(0, len*2);
|
||||||
t = tmp;
|
t = RSTRING(tmp)->ptr;
|
||||||
|
|
||||||
for (; s < send; s++) {
|
for (; s < send; s++) {
|
||||||
if (ismbchar(*s)) {
|
if (ismbchar(*s)) {
|
||||||
|
@ -1073,8 +1073,9 @@ rb_reg_s_quote(argc, argv)
|
||||||
*t++ = *s;
|
*t++ = *s;
|
||||||
}
|
}
|
||||||
kcode_reset_option();
|
kcode_reset_option();
|
||||||
|
rb_str_resize(tmp, t - RSTRING(tmp)->ptr);
|
||||||
|
|
||||||
return rb_str_new(tmp, t - tmp);
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
|
@ -50,8 +50,8 @@ end
|
||||||
$outcount = 0;
|
$outcount = 0;
|
||||||
def fromout(date, from, subj)
|
def fromout(date, from, subj)
|
||||||
return if !date
|
return if !date
|
||||||
y = m = d = 0
|
|
||||||
y, m, d = parsedate(date) if date
|
y, m, d = parsedate(date) if date
|
||||||
|
y ||= 0; m ||= 0; d ||= 0
|
||||||
if from
|
if from
|
||||||
from.gsub! /\n/, ""
|
from.gsub! /\n/, ""
|
||||||
else
|
else
|
||||||
|
|
12
string.c
12
string.c
|
@ -1381,16 +1381,16 @@ static VALUE
|
||||||
rb_str_reverse_bang(str)
|
rb_str_reverse_bang(str)
|
||||||
VALUE str;
|
VALUE str;
|
||||||
{
|
{
|
||||||
char *s, *e, *p, *q;
|
char *s, *e;
|
||||||
|
char c;
|
||||||
|
|
||||||
s = RSTRING(str)->ptr;
|
s = RSTRING(str)->ptr;
|
||||||
e = s + RSTRING(str)->len - 1;
|
e = s + RSTRING(str)->len - 1;
|
||||||
p = q = ALLOCA_N(char, RSTRING(str)->len);
|
while (s < e) {
|
||||||
|
c = *s;
|
||||||
while (e >= s) {
|
*s++ = *e;
|
||||||
*p++ = *e--;
|
*e-- = c;
|
||||||
}
|
}
|
||||||
MEMCPY(RSTRING(str)->ptr, q, char, RSTRING(str)->len);
|
|
||||||
|
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
12
struct.c
12
struct.c
|
@ -338,10 +338,10 @@ rb_struct_to_s(s)
|
||||||
VALUE s;
|
VALUE s;
|
||||||
{
|
{
|
||||||
char *cname = rb_class2name(CLASS_OF(s));
|
char *cname = rb_class2name(CLASS_OF(s));
|
||||||
char *buf = ALLOCA_N(char, strlen(cname) + 4);
|
VALUE str = rb_str_new(0, strlen(cname) + 4);
|
||||||
|
|
||||||
sprintf(buf, "#<%s>", cname);
|
sprintf(RSTRING(str)->ptr, "#<%s>", cname);
|
||||||
return rb_str_new2(buf);
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
@ -386,10 +386,10 @@ rb_struct_inspect(s)
|
||||||
{
|
{
|
||||||
if (rb_inspecting_p(s)) {
|
if (rb_inspecting_p(s)) {
|
||||||
char *cname = rb_class2name(CLASS_OF(s));
|
char *cname = rb_class2name(CLASS_OF(s));
|
||||||
char *buf = ALLOCA_N(char, strlen(cname) + 8);
|
VALUE str = rb_str_new(0, strlen(cname) + 8);
|
||||||
|
|
||||||
sprintf(buf, "#<%s:...>", cname);
|
sprintf(RSTRING(str)->ptr, "#<%s:...>", cname);
|
||||||
return rb_str_new2(buf);
|
return str;
|
||||||
}
|
}
|
||||||
return rb_protect_inspect(inspect_struct, s, 0);
|
return rb_protect_inspect(inspect_struct, s, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#define RUBY_VERSION "1.6.1"
|
#define RUBY_VERSION "1.6.2"
|
||||||
#define RUBY_RELEASE_DATE "2000-10-05"
|
#define RUBY_RELEASE_DATE "2000-10-08"
|
||||||
#define RUBY_VERSION_CODE 161
|
#define RUBY_VERSION_CODE 162
|
||||||
#define RUBY_RELEASE_CODE 20001005
|
#define RUBY_RELEASE_CODE 20001008
|
||||||
|
|
Loading…
Add table
Reference in a new issue