diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-04 11:01:41 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-06-04 11:01:41 +0000 |
commit | 71fd73dff88fa29b41f92e39412d31ad651dbea4 (patch) | |
tree | b56ef7e77a70c2c7655735a911546a9a9ab955b6 /internal.h | |
parent | 41819dc447067891a2154f1c99c0cb4589f7b73f (diff) | |
download | ruby-71fd73dff88fa29b41f92e39412d31ad651dbea4.tar.gz |
* process.c (rb_exec_fillarg): allocate one more element before
beginning in argv_str for try_with_sh.
* internal.h (ARGVSTR2ARGC): adjust for the above change.
(ARGVSTR2ARGV): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/internal.h b/internal.h index 37541cc145..48a3a763d5 100644 --- a/internal.h +++ b/internal.h @@ -159,10 +159,12 @@ st_index_t rb_hash_proc(st_index_t hash, VALUE proc); /* process.c */ -/* argv_str contains an extra element for terminating NULL used by execve.. +/* argv_str contains extra two elements. + * The beginning one is for /bin/sh used by exec_with_sh. + * The last one for terminating NULL used by execve. * See rb_exec_fillarg() in process.c. */ -#define ARGVSTR2ARGC(argv_str) (RSTRING_LEN(argv_str) / sizeof(char *) - 1) -#define ARGVSTR2ARGV(argv_str) ((char **)RSTRING_PTR(argv_str)) +#define ARGVSTR2ARGC(argv_str) (RSTRING_LEN(argv_str) / sizeof(char *) - 2) +#define ARGVSTR2ARGV(argv_str) ((char **)RSTRING_PTR(argv_str) + 1) /* rational.c */ VALUE rb_lcm(VALUE x, VALUE y); |