diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-07 03:31:54 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-07 03:31:54 +0000 |
commit | 819619495ae880d03deee55b39b7381a38fb2b03 (patch) | |
tree | ee7aeecc7f649f5d458448bc4c973c665dfa2aac /io.c | |
parent | 81201b4007dfa68765d168321edbc3a163d9f2c8 (diff) | |
download | ruby-819619495ae880d03deee55b39b7381a38fb2b03.tar.gz |
* io.c (pipe_open): fix for win32 platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -3061,7 +3061,7 @@ pipe_open(const char *cmd, int argc, VALUE *argv, const char *mode) struct popen_arg arg; #elif defined(_WIN32) int openmode = rb_io_mode_modenum(mode); - char *exename = NULL; + const char *exename = NULL; #endif FILE *fp = 0; int fd = -1; @@ -3135,9 +3135,8 @@ pipe_open(const char *cmd, int argc, VALUE *argv, const char *mode) args[i] = RSTRING_PTR(argv[i]); } args[i] = NULL; - cmd = ALLOCA_N(char, rb_w32_argv_size(args)); - rb_w32_join_argv(cmd, args); - exename = RSTRING_PTR(prog); + exename = cmd; + cmd = rb_w32_join_argv(ALLOCA_N(char, rb_w32_argv_size(args)), args); } while ((pid = rb_w32_pipe_exec(cmd, exename, openmode, &fd)) == -1) { /* exec failed */ @@ -3149,7 +3148,7 @@ pipe_open(const char *cmd, int argc, VALUE *argv, const char *mode) rb_thread_sleep(1); break; default: - rb_sys_fail(RSTRING_PTR(prog)); + rb_sys_fail(cmd); break; } } |