[Bug:1.9] reading after EOF with textmode

e$B$3$s$K$A$O!"$J$+$`$ie(B(e$B$&e(B)e$B$G$9!#e(B

e$B%F%-%9%H%b!<%I;~$K0lEYe(BEOFe$B$KE~C#$9$k$H!“e(Brewinde$B$de(Bseeke$B$G%]%$%s%?e(B
e$B$r0\F0$9$k$H$+?7$7$$%G!<%?$,E~C#$9$k$H$+$7$F$b!“e(BEOFe$B>uBV$+$iC&e(B
e$B=P$G$-$J$$$h$&$G$9!#e(B
more_char()e$B$Ge(BEOFe$B$r8!CN$7$?;~E@$Ge(Breadconve$B$r%j%;%C%H$9$kI,MW$,e(B
e$B$”$k$h$&$K;W$($k$N$G$9$,!”$=$&$$$&M}2r$G@5$7$$$G$7$g$&$+e(B?

Index: io.c

— io.c (revision 19991)
+++ io.c (working copy)
@@ -1457,6 +1457,8 @@ make_readconv(rb_io_t *fptr)
}
}

+static void clear_readconv(rb_io_t *fptr);
+
static int
more_char(rb_io_t *fptr)
{
@@ -1499,8 +1501,10 @@ more_char(rb_io_t *fptr)
if (cbuf_len0 != fptr->cbuf_len)
return 0;

  •    if (res == econv_finished)
    
  • if (res == econv_finished) {

  •  clear_readconv(fptr);
           return -1;
    
  • }

      if (res == econv_source_buffer_empty) {
          if (fptr->rbuf_len == 0) {
    

e$B$=$l$G$O!#e(B

e$B%A%1%C%He(B #689 e$B$,99?7$5$l$^$7$?!#e(B (by Yukihiro M.)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B

fixed by r20045

http://redmine.ruby-lang.org/issues/show/689