diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-25 01:26:49 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-25 01:26:49 +0000 |
commit | e5cb074c877de2ca8b6d3824aed298ae55f2bfcd (patch) | |
tree | 677c16fcb569dd464a4a210a5f4c183573c3d971 /io.c | |
parent | 01c1f761566442c7dc9ed0bcc8fc54e7a8e91bdb (diff) | |
download | ruby-e5cb074c877de2ca8b6d3824aed298ae55f2bfcd.tar.gz ruby-e5cb074c877de2ca8b6d3824aed298ae55f2bfcd.tar.xz ruby-e5cb074c877de2ca8b6d3824aed298ae55f2bfcd.zip |
* io.c (read_all): [ruby-dev:24955]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@7367 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1010,9 +1010,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 (;;) { @@ -1033,6 +1034,7 @@ read_all(fptr, siz, str) rb_str_resize(str, siz); } if (bytes != siz) rb_str_resize(str, bytes); + OBJ_TAINT(str); return str; } @@ -1074,7 +1076,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); |