Feature #2372 » buffering_readall.patch
io.c (working copy) | ||
---|---|---|
return 0;
|
||
if (res == econv_finished) {
|
||
clear_readconv(fptr);
|
||
return -1;
|
||
}
|
||
... | ... | |
else rb_str_set_len(str, 0);
|
||
make_readconv(fptr, 0);
|
||
while (1) {
|
||
if (fptr->cbuf_len) {
|
||
if (fptr->cbuf_len > fptr->cbuf_capa/2) {
|
||
io_shift_cbuf(fptr, fptr->cbuf_len, &str);
|
||
}
|
||
if (more_char(fptr) == -1) {
|
||
if (fptr->cbuf_len) {
|
||
io_shift_cbuf(fptr, fptr->cbuf_len, &str);
|
||
}
|
||
clear_readconv(fptr);
|
||
return io_enc_str(str, fptr);
|
||
}
|
||
}
|
||
... | ... | |
}
|
||
}
|
||
} while (more_char(fptr) != -1);
|
||
clear_readconv(fptr);
|
||
*lp = limit;
|
||
return EOF;
|
||
}
|
||
... | ... | |
}
|
||
}
|
||
if (more_char(fptr) == -1) {
|
||
clear_readconv(fptr);
|
||
/* ignore an incomplete character before EOF */
|
||
return io;
|
||
}
|