summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-07 07:36:40 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-01-07 07:36:40 +0000
commit6d481a4ae440532dcf674adf910c5cfa802f4679 (patch)
tree9eb994643aa02d75494ab17b10f33eee31bf8a9c /process.c
parent954826f7a84722628b5386868dfdf7da2f4bd58a (diff)
* hash.c (env_clear): new Hash compatible method.
* hash.c (env_shift): ditto. * hash.c (env_invert): ditto. * hash.c (env_replace): ditto. * hash.c (env_update): ditto. * array.c (rb_ary_join): dispatch based on "to_str". * array.c (rb_ary_times): ditto. * array.c (rb_ary_equal): ditto. * process.c (rb_f_exec): dispatch based on "to_ary". * eval.c (umethod_bind): exact class match is not required. relax the restriction to subclasses. * eval.c (rb_eval): call "inherited" before executing class body. * class.c (rb_define_class): call "inherited" after defining the constant. * class.c (rb_define_class_under): ditto. * eval.c (massign): expand first element if RHS is an array and its size is 1, and LHS has concrete assignment target (i.e. LHS has target(s) other than *var). * eval.c (massign): avoid unnecessary avalue/svalue conversion. * eval.c (rb_yield_0): ditto * array.c (rb_ary_update): do not allocate unused array if rpl is nil (i.e. merely removing elements). * io.c (io_read): should resize supplied string if it's shorter than expected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/process.c b/process.c
index 0866a09..7efbafc 100644
--- a/process.c
+++ b/process.c
@@ -695,20 +695,20 @@ rb_f_exec(argc, argv)
VALUE *argv;
{
VALUE prog = 0;
+ VALUE tmp;
if (argc == 0) {
rb_raise(rb_eArgError, "wrong number of arguments");
}
- if (TYPE(argv[0]) == T_ARRAY) {
- if (RARRAY(argv[0])->len != 2) {
+ tmp = rb_check_array_type(argv[0]);
+ if (!NIL_P(tmp)) {
+ if (RARRAY(tmp)->len != 2) {
rb_raise(rb_eArgError, "wrong first argument");
}
- prog = RARRAY(argv[0])->ptr[0];
- argv[0] = RARRAY(argv[0])->ptr[1];
- }
- if (prog) {
+ prog = RARRAY(tmp)->ptr[0];
SafeStringValue(prog);
+ argv[0] = RARRAY(tmp)->ptr[1];
}
if (argc == 1 && prog == 0) {
VALUE cmd = argv[0];