diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-04 07:26:47 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-09-04 07:26:47 +0000 |
commit | d9d3a1b2fb10e01d8ace6aa2addeca964ea2f573 (patch) | |
tree | c2c33a8c233ddf3e4b6fd8d5bacdf2e11bd3f676 /io.c | |
parent | 1165542a92724aadfa5007c47cfae7a631af669e (diff) |
* io.c (pipe_open): command name should not contain null bytes.
[ruby-dev:29421]
* process.c (proc_spawn): ditto.
* process.c (proc_spawn_n): ditto.
* process.c (rb_f_system): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10850 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -3030,7 +3030,7 @@ pipe_open(pstr, pname, mode) #if defined(DJGPP) || defined(__human68k__) || defined(__VMS) FILE *f; - if (!pname) pname = StringValuePtr(pstr); + if (!pname) pname = StringValueCStr(pstr); f = popen(pname, mode); if (!f) rb_sys_fail(pname); @@ -3055,8 +3055,7 @@ pipe_open(pstr, pname, mode) int pid; FILE *fpr, *fpw; - if (!pname) pname = StringValuePtr(pstr); - + if (!pname) pname = StringValueCStr(pstr); retry: pid = pipe_exec(pname, rb_io_mode_modenum(mode), &fpr, &fpw); if (pid == -1) { /* exec failed */ @@ -3089,7 +3088,7 @@ retry: int pid, pr[2], pw[2]; volatile int doexec; - if (!pname) pname = StringValuePtr(pstr); + if (!pname) pname = StringValueCStr(pstr); if (((modef & FMODE_READABLE) && pipe(pr) == -1) || ((modef & FMODE_WRITABLE) && pipe(pw) == -1)) |