summaryrefslogtreecommitdiffstats
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
commit3683a5311724f55be3a2d4bb08dab7efe20baf7f (patch)
treec2c33a8c233ddf3e4b6fd8d5bacdf2e11bd3f676 /io.c
parent5ce4e9c7a8ef5d73fdc5307bfde227a58f44afb7 (diff)
downloadruby-3683a5311724f55be3a2d4bb08dab7efe20baf7f.tar.gz
ruby-3683a5311724f55be3a2d4bb08dab7efe20baf7f.tar.xz
ruby-3683a5311724f55be3a2d4bb08dab7efe20baf7f.zip
* 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: http://svn.ruby-lang.org/repos/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 d454d33ed..411887297 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))