summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-11-25 09:03:08 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-11-25 09:03:08 +0000
commitebab487fcd7633038b9272ddbe31c268cda15723 (patch)
treee7880ae217a2a58dbe35bcf0f94744bc03805e08 /process.c
parent8e48dc16e97a783a69f0972b4882ad2faae561ea (diff)
19991125
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@570 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/process.c b/process.c
index 57b4300..211445b 100644
--- a/process.c
+++ b/process.c
@@ -600,6 +600,13 @@ rb_f_system(argc, argv)
VALUE cmd;
int state;
+ fflush(stdout);
+ fflush(stderr);
+ if (argc == 0) {
+ rb_last_status = INT2FIX(0);
+ rb_raise(rb_eArgError, "wrong # of arguments");
+ }
+
if (TYPE(argv[0]) == T_ARRAY) {
if (RARRAY(argv[0])->len != 2) {
rb_raise(rb_eArgError, "wrong first argument");
@@ -619,6 +626,11 @@ rb_f_system(argc, argv)
VALUE cmd;
int state;
+ if (argc == 0) {
+ rb_last_status = INT2FIX(0);
+ rb_raise(rb_eArgError, "wrong # of arguments");
+ }
+
if (TYPE(argv[0]) == T_ARRAY) {
if (RARRAY(argv[0])->len != 2) {
rb_raise(rb_eArgError, "wrong first argument");
@@ -667,7 +679,7 @@ rb_f_system(argc, argv)
#if defined(USE_CWGUSI)
rb_notimplement();
#else
- volatile VALUE prog = 0;
+ volatile VALUE prog = 0;
int pid;
int i;