From d500908417d88291a649a46de2766c3aa8dcf82d Mon Sep 17 00:00:00 2001 From: yugui Date: Tue, 31 May 2011 00:13:03 +0000 Subject: merges r31747 and r31758 from trunk into ruby_1_9_2. -- * io.c (fill_cbuf): finish reading at EOF. -- * io.c (fill_cbuf): return MORE_CHAR_SUSPENDED when cbuf is not empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@31841 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- io.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'io.c') diff --git a/io.c b/io.c index 744da5c4bb..f99bc30f58 100644 --- a/io.c +++ b/io.c @@ -1694,10 +1694,15 @@ fill_cbuf(rb_io_t *fptr, int ec_flags) res = rb_econv_convert(fptr->readconv, NULL, NULL, &dp, de, 0); fptr->cbuf_len += (int)(dp - ds); rb_econv_check_error(fptr->readconv); + break; } } } } + if (cbuf_len0 != fptr->cbuf_len) + return MORE_CHAR_SUSPENDED; + + return MORE_CHAR_FINISHED; } static VALUE -- cgit v1.2.3