From 3683a5311724f55be3a2d4bb08dab7efe20baf7f Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 4 Sep 2006 07:26:47 +0000 Subject: * 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 --- io.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'io.c') 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)) -- cgit