summaryrefslogtreecommitdiffstats
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-25 15:23:19 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-25 15:23:19 +0000
commit6aa3d1dc5a648280174a331f6746bd85dd477c1c (patch)
tree9da6064ce0736841f796c19b2b85008125ef3988 /io.c
parent008afdc787618c39c52cc338a61d804cdb6ba795 (diff)
downloadruby-6aa3d1dc5a648280174a331f6746bd85dd477c1c.tar.gz
ruby-6aa3d1dc5a648280174a331f6746bd85dd477c1c.tar.xz
ruby-6aa3d1dc5a648280174a331f6746bd85dd477c1c.zip
* io.c (io_read): move StringValue() check before GetOpenFile().
[ruby-dev:24959] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7376 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 83a7abb5d..99cbd1fb5 100644
--- a/io.c
+++ b/io.c
@@ -1033,7 +1033,6 @@ read_all(fptr, siz, str)
str = rb_str_new(0, siz);
}
else {
- StringValue(str);
rb_str_resize(str, siz);
}
for (;;) {
@@ -1198,6 +1197,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);