read_all ftello (instead ftell) (ruby-core:392)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
844de6b24b
commit
438ea00969
2
io.c
2
io.c
@ -648,7 +648,7 @@ read_all(fptr, siz)
|
|||||||
READ_CHECK(fptr->f);
|
READ_CHECK(fptr->f);
|
||||||
if (!siz) siz = BUFSIZ;
|
if (!siz) siz = BUFSIZ;
|
||||||
str = rb_tainted_str_new(0, siz);
|
str = rb_tainted_str_new(0, siz);
|
||||||
pos = ftell(fptr->f);
|
pos = ftello(fptr->f);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f);
|
n = rb_io_fread(RSTRING(str)->ptr+bytes, siz-bytes, fptr->f);
|
||||||
if (pos > 0 && n == 0 && bytes == 0) {
|
if (pos > 0 && n == 0 && bytes == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user