summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-25 15:50:18 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-25 15:50:18 +0000
commit0d39336f6c99de57357fa4a2aa150a5c048840ba (patch)
tree48016851887b47f0525d730a012bb84e6f043ba0 /io.c
parent87ebe411a66a608b8b73ad5c05ba6a53df1a8e08 (diff)
* io.c (io_read): move StringValue() check before GetOpenFile().
[ruby-dev:24959] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7377 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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 ec37d03..2d447c1 100644
--- a/io.c
+++ b/io.c
@@ -1013,7 +1013,6 @@ read_all(fptr, siz, str)
str = rb_str_new(0, siz);
}
else {
- StringValue(str);
rb_str_resize(str, siz);
}
for (;;) {
@@ -1066,6 +1065,7 @@ io_read(argc, argv, io)
rb_scan_args(argc, argv, "02", &length, &str);
if (NIL_P(length)) {
+ if (!NIL_P(str)) StringValue(str);
GetOpenFile(io, fptr);
rb_io_check_readable(fptr);
return read_all(fptr, remain_size(fptr), str);