summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-21 18:04:11 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-21 18:04:11 +0000
commit9cf879d7a5f27d1965c99196c6364936f95b256d (patch)
tree052ad936423556c9df40d190bdaee472899d4932
parent63a5a45a01b656adbc0457036a0f575b847b2a08 (diff)
* error.c (rb_sys_fail): should not specify errno explicitly.
[ruby-dev:20264] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog10
-rw-r--r--error.c7
-rw-r--r--sample/test.rb3
3 files changed, 13 insertions, 7 deletions
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 <matz@ruby-lang.org>
+
+ * error.c (rb_sys_fail): should not specify errno explicitly.
+ [ruby-dev:20264]
+
Thu May 22 02:46:38 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* eval.c (rb_eval): splat NODE_RESTARY. [ruby-dev:20268]
@@ -17,6 +22,11 @@ Thu May 22 01:11:15 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* parse.y (yylex): slight optimization.
+Wed May 21 23:07:08 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * error.c (rb_sys_fail): should not specify errno explicitly.
+ [ruby-dev:20264]
+
Wed May 21 20:51:47 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* 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])}