diff --git a/ChangeLog b/ChangeLog index ac9afe951e..bc89a69220 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed May 21 23:07:08 2003 Yukihiro Matsumoto + + * error.c (rb_sys_fail): should not specify errno explicitly. + [ruby-dev:20264] + Thu May 22 02:46:38 2003 Nobuyoshi Nakada * eval.c (rb_eval): splat NODE_RESTARY. [ruby-dev:20268] @@ -17,6 +22,11 @@ Thu May 22 01:11:15 2003 Nobuyoshi Nakada * parse.y (yylex): slight optimization. +Wed May 21 23:07:08 2003 Yukihiro Matsumoto + + * error.c (rb_sys_fail): should not specify errno explicitly. + [ruby-dev:20264] + Wed May 21 20:51:47 2003 Nobuyoshi Nakada * Makefile.in, bcc32/Makefile.sub, win32/Makefile.sub, diff --git a/error.c b/error.c index a90167cf2e..e2d14304db 100644 --- a/error.c +++ b/error.c @@ -727,16 +727,15 @@ rb_sys_fail(mesg) { extern int errno; int n = errno; - VALUE argv[2]; + VALUE arg; errno = 0; if (n == 0) { rb_bug("rb_sys_fail() - errno == 0"); } - argv[0] = mesg ? rb_str_new2(mesg) : Qnil; - argv[1] = INT2NUM(n); - rb_exc_raise(rb_class_new_instance(2, argv, get_syserr(n))); + arg = mesg ? rb_str_new2(mesg) : Qnil; + rb_exc_raise(rb_class_new_instance(1, &arg, get_syserr(n))); } void diff --git a/sample/test.rb b/sample/test.rb index 1067a95c0f..7f50141d93 100644 --- a/sample/test.rb +++ b/sample/test.rb @@ -109,7 +109,6 @@ a,b,*c = *[*[]]; test_ok([a,b,c] == [nil,nil,[]]) a,b,*c = *[*[1]]; test_ok([a,b,c] == [1,nil,[]]) a,b,*c = *[*[1,2]]; test_ok([a,b,c] == [1,2,[]]) -def f; yield; end; f {|a| test_ok(a == nil)} def f; yield nil; end; f {|a| test_ok(a == nil)} def f; yield 1; end; f {|a| test_ok(a == 1)} def f; yield []; end; f {|a| test_ok(a == [])} @@ -122,11 +121,9 @@ def f; yield [*[1,2]]; end; f {|a| test_ok(a == [1,2])} def f; yield *nil; end; f {|a| test_ok(a == nil)} def f; yield *1; end; f {|a| test_ok(a == 1)} -def f; yield *[]; end; f {|a| test_ok(a == nil)} def f; yield *[1]; end; f {|a| test_ok(a == 1)} def f; yield *[nil]; end; f {|a| test_ok(a == nil)} def f; yield *[[]]; end; f {|a| test_ok(a == [])} -def f; yield *[*[]]; end; f {|a| test_ok(a == nil)} def f; yield *[*[1]]; end; f {|a| test_ok(a == 1)} def f; yield *[*[1,2]]; end; f {|a| test_ok(a == [1,2])}