summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-09 03:34:47 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-12-09 03:34:47 +0000
commitb9c6120e079075e0bb2b4acde395d25e592c3fe2 (patch)
tree86c83c72e201fa4aa545bcdb3c322d7421cacc52 /io.c
parent3d66cc4c6b9585227b6489497d66dbc065c6f6a6 (diff)
downloadruby-b9c6120e079075e0bb2b4acde395d25e592c3fe2.tar.gz
* io.c (pipe_open): should set prog if argc != 0.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7518 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/io.c b/io.c
index 8a6e1f40ef..8256b57782 100644
--- a/io.c
+++ b/io.c
@@ -2915,7 +2915,8 @@ pipe_open(argc, argv, mode)
}
}
#else
- prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
+ if (argc)
+ prog = rb_ary_join(rb_ary_new4(argc, argv), rb_str_new2(" "));
fp = popen(StringValueCStr(prog), mode);
if (!fp) rb_sys_fail(RSTRING(prog)->ptr);
fd = fileno(fp);