summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index b357df2b37..37a30fa0d0 100644
--- a/io.c
+++ b/io.c
@@ -3007,7 +3007,7 @@ rb_f_open(argc, argv)
char *str = StringValuePtr(argv[0]);
if (str[0] == '|') {
- VALUE tmp = rb_str_new(str+1, RSTRING(str)->len-1);
+ VALUE tmp = rb_str_new(str+1, RSTRING(argv[0])->len-1);
OBJ_INFECT(tmp, argv[0]);
argv[0] = tmp;
return rb_io_s_popen(argc, argv, rb_cIO);