summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-17 08:21:47 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-17 08:21:47 +0000
commitd64ba37ad06b6817687e50ad66b6d14733a682eb (patch)
tree49da19092b6e5f71634e85b358cb010c4e222bad /process.c
parentd90075cb10d6d947b0262baf4903efa40db0fbb1 (diff)
process.c: constify
* process.c (rb_execarg_new, rb_execarg_init): constify argv. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/process.c b/process.c
index 33a2948..f0ed4a4 100644
--- a/process.c
+++ b/process.c
@@ -2198,7 +2198,7 @@ rb_exec_fillarg(VALUE prog, int argc, VALUE *argv, VALUE env, VALUE opthash, VAL
}
VALUE
-rb_execarg_new(int argc, VALUE *argv, int accept_shell)
+rb_execarg_new(int argc, const VALUE *argv, int accept_shell)
{
VALUE execarg_obj;
struct rb_execarg *eargp;
@@ -2217,13 +2217,17 @@ rb_execarg_get(VALUE execarg_obj)
}
VALUE
-rb_execarg_init(int argc, VALUE *argv, int accept_shell, VALUE execarg_obj)
+rb_execarg_init(int argc, const VALUE *orig_argv, int accept_shell, VALUE execarg_obj)
{
struct rb_execarg *eargp = rb_execarg_get(execarg_obj);
VALUE prog, ret;
VALUE env = Qnil, opthash = Qnil;
+ VALUE argv_buf;
+ VALUE *argv = ALLOCV_N(VALUE, argv_buf, argc);
+ MEMCPY(argv, orig_argv, VALUE, argc);
prog = rb_exec_getargs(&argc, &argv, accept_shell, &env, &opthash);
rb_exec_fillarg(prog, argc, argv, env, opthash, execarg_obj);
+ ALLOCV_END(argv_buf);
ret = eargp->use_shell ? eargp->invoke.sh.shell_script : eargp->invoke.cmd.command_name;
RB_GC_GUARD(execarg_obj);
return ret;