From f449c04a3648f56a535399d4108b738e36059455 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 10 Dec 2003 08:26:36 +0000 Subject: * io.c (read_all): should return given string even if data read is empty. [ruby-dev:22207] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'io.c') diff --git a/io.c b/io.c index 593e1facc2..19690ddc4d 100644 --- a/io.c +++ b/io.c @@ -801,7 +801,6 @@ read_all(fptr, siz, str) siz += BUFSIZ; rb_str_resize(str, siz); } - if (bytes == 0) return rb_str_new(0,0); if (bytes != siz) rb_str_resize(str, bytes); return str; @@ -3456,7 +3455,7 @@ rb_io_ctl(io, req, arg, io_p) rb_raise(rb_eArgError, "return value overflowed string"); } - if (fptr->f2 && fileno(fptr->f) != fileno(fptr->f2)) { + if (fptr->f2 && fileno(fptr->f) != fileno(fptr->f2)) { /* call on f2 too; ignore result */ io_cntl(fileno(fptr->f2), cmd, narg, io_p); } -- cgit v1.2.3