summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 07:26:47 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-04 07:26:47 +0000
commitd9d3a1b2fb10e01d8ace6aa2addeca964ea2f573 (patch)
treec2c33a8c233ddf3e4b6fd8d5bacdf2e11bd3f676 /io.c
parent1165542a92724aadfa5007c47cfae7a631af669e (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.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/io.c b/io.c
index d454d33edd..4118872972 100644
--- a/io.c
+++ b/io.c
@@ -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))