1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* process.c (rb_execarg_init): take a VALUE argument instead of

struct rb_execarg.
  (rb_execarg_new): follow the rb_execarg_init change.
  (rb_exec_arg_init): ditto.

* internal.h (rb_execarg_init): follow the definition change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36162 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
akr 2012-06-21 09:39:10 +00:00
parent 64ae33a18a
commit 46e23dc03d
3 changed files with 18 additions and 6 deletions

View file

@ -1,3 +1,12 @@
Thu Jun 21 18:36:43 2012 Tanaka Akira <akr@fsij.org>
* process.c (rb_execarg_init): take a VALUE argument instead of
struct rb_execarg.
(rb_execarg_new): follow the rb_execarg_init change.
(rb_exec_arg_init): ditto.
* internal.h (rb_execarg_init): follow the definition change.
Thu Jun 21 17:20:44 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (new_args_tail_gen): fix GC problem of keyword rest

View file

@ -290,7 +290,7 @@ int rb_exec_async_signal_safe(const struct rb_execarg *e, char *errmsg, size_t e
rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, char *errmsg, size_t errmsg_buflen);
VALUE rb_execarg_new(int argc, VALUE *argv, int accept_shell);
struct rb_execarg *rb_execarg_get(VALUE execarg_obj); /* dangerous. needs GC guard. */
VALUE rb_execarg_init(int argc, VALUE *argv, int accept_shell, struct rb_execarg *e);
VALUE rb_execarg_init(int argc, VALUE *argv, int accept_shell, VALUE execarg_obj);
int rb_execarg_addopt(struct rb_execarg *e, VALUE key, VALUE val);
void rb_execarg_fixup(VALUE execarg_obj);
int rb_execarg_run_options(const struct rb_execarg *e, struct rb_execarg *s, char* errmsg, size_t errmsg_buflen);

View file

@ -2059,7 +2059,7 @@ rb_execarg_new(int argc, VALUE *argv, int accept_shell)
struct rb_execarg *e;
execarg_obj = TypedData_Make_Struct(rb_cData, struct rb_execarg, &exec_arg_data_type, e);
hide_obj(execarg_obj);
rb_execarg_init(argc, argv, accept_shell, e);
rb_execarg_init(argc, argv, accept_shell, execarg_obj);
return execarg_obj;
}
@ -2071,19 +2071,22 @@ struct rb_execarg *rb_execarg_get(VALUE execarg_obj)
}
VALUE
rb_execarg_init(int argc, VALUE *argv, int accept_shell, struct rb_execarg *e)
rb_execarg_init(int argc, VALUE *argv, int accept_shell, VALUE execarg_obj)
{
VALUE prog;
struct rb_execarg *e = rb_execarg_get(execarg_obj);
VALUE prog, ret;
VALUE env = Qnil, opthash = Qnil;
prog = rb_exec_getargs(&argc, &argv, accept_shell, &env, &opthash);
rb_exec_fillarg(prog, argc, argv, env, opthash, e);
return e->use_shell ? e->invoke.sh.shell_script : e->invoke.cmd.command_name;
ret = e->use_shell ? e->invoke.sh.shell_script : e->invoke.cmd.command_name;
RB_GC_GUARD(execarg_obj);
return ret;
}
VALUE
rb_exec_arg_init(int argc, VALUE *argv, int accept_shell, struct rb_exec_arg *e)
{
return rb_execarg_init(argc, argv, accept_shell, rb_execarg_get(e->execarg_obj));
return rb_execarg_init(argc, argv, accept_shell, e->execarg_obj);
}
static int