summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-04 01:44:27 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-06-04 01:44:27 +0000
commit859869e52285a36255c8bed6bc0bf5dd80ac0010 (patch)
tree388336840ebab30ad28797da4477fa77ef7b24ad /io.c
parent436d819bf2f51b7e01aab070f92e8864793c8d16 (diff)
* io.c (pipe_open): follow up changes in r35889.
* process.c (proc_spawn_n): now uses char ** instead of VALUE *. * process.c (rb_spawn_process): prog is now VALUE of String, not char *. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c32
1 files changed, 2 insertions, 30 deletions
diff --git a/io.c b/io.c
index c935ff1a3f..b6c6157598 100644
--- a/io.c
+++ b/io.c
@@ -5501,24 +5501,6 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
cmd = StringValueCStr(prog);
#endif
-#if !defined(HAVE_FORK)
- if (!eargp) {
- /* fork : IO.popen("-") */
- argc = 0;
- argv = 0;
- }
- else if (eargp->argc) {
- /* no shell : IO.popen([prog, arg0], arg1, ...) */
- argc = eargp->argc;
- argv = eargp->argv;
- }
- else {
- /* with shell : IO.popen(prog) */
- argc = 0;
- argv = 0;
- }
-#endif
-
#if defined(HAVE_FORK)
arg.execp = eargp;
arg.modef = fmode;
@@ -5599,18 +5581,8 @@ pipe_open(struct rb_exec_arg *eargp, VALUE prog, const char *modestr, int fmode,
fd = arg.pair[1];
}
#elif defined(_WIN32)
- if (argc) {
- int i;
-
- if (argc >= (int)(FIXNUM_MAX / sizeof(char *))) {
- rb_raise(rb_eArgError, "too many arguments");
- }
- argbuf = rb_str_tmp_new((argc+1) * sizeof(char *));
- args = (void *)RSTRING_PTR(argbuf);
- for (i = 0; i < argc; ++i) {
- args[i] = StringValueCStr(argv[i]);
- }
- args[i] = NULL;
+ if (eargp && eargp->argv_str) {
+ args = (char **)RSTRING_PTR(eargp->argv_str);
}
switch (fmode & (FMODE_READABLE|FMODE_WRITABLE)) {
case FMODE_READABLE|FMODE_WRITABLE: