summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-25 01:58:31 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-11-25 01:58:31 +0000
commit51c48c29d8d89c729075f611e7c25abf92f7aa41 (patch)
tree1be95a2f4bce6dc5f0be7f378639937c926f77f8 /io.c
parent624f62c515edeca8e6b9fdc01bfea736ecd7dbe2 (diff)
* configure.in: AC_PREREQ(2.53) [ruby-core:03800]
* io.c (read_all): [ruby-dev:24955] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7369 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io.c b/io.c
index dd8601d0f4..83a7abb5dc 100644
--- a/io.c
+++ b/io.c
@@ -1030,9 +1030,10 @@ read_all(fptr, siz, str)
if (siz == 0) siz = BUFSIZ;
if (NIL_P(str)) {
- str = rb_tainted_str_new(0, siz);
+ str = rb_str_new(0, siz);
}
else {
+ StringValue(str);
rb_str_resize(str, siz);
}
for (;;) {
@@ -1053,6 +1054,7 @@ read_all(fptr, siz, str)
rb_str_resize(str, siz);
}
if (bytes != siz) rb_str_resize(str, bytes);
+ OBJ_TAINT(str);
return str;
}
@@ -1206,7 +1208,7 @@ io_read(argc, argv, io)
}
if (NIL_P(str)) {
- str = rb_str_new(0, len);
+ str = rb_tainted_str_new(0, len);
}
else {
StringValue(str);