* io.c (swallow): should use more_char() instead of fill_cbuf().
suggested by akr. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
552243aa15
commit
daac3ed0b4
@ -1,3 +1,8 @@
|
|||||||
|
Thu May 13 18:15:33 2010 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
|
* io.c (swallow): should use more_char() instead of fill_cbuf().
|
||||||
|
suggested by akr.
|
||||||
|
|
||||||
Thu May 13 17:56:07 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Thu May 13 17:56:07 2010 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/io/console/console.c (console_set_echo, console_echo_p): use
|
* ext/io/console/console.c (console_set_echo, console_echo_p): use
|
||||||
|
6
io.c
6
io.c
@ -2296,7 +2296,6 @@ swallow(rb_io_t *fptr, int term)
|
|||||||
if (NEED_READCONV(fptr)) {
|
if (NEED_READCONV(fptr)) {
|
||||||
rb_encoding *enc = io_read_encoding(fptr);
|
rb_encoding *enc = io_read_encoding(fptr);
|
||||||
int needconv = rb_enc_mbminlen(enc) != 1;
|
int needconv = rb_enc_mbminlen(enc) != 1;
|
||||||
VALUE v;
|
|
||||||
make_readconv(fptr, 0);
|
make_readconv(fptr, 0);
|
||||||
do {
|
do {
|
||||||
size_t cnt;
|
size_t cnt;
|
||||||
@ -2315,10 +2314,7 @@ swallow(rb_io_t *fptr, int term)
|
|||||||
}
|
}
|
||||||
io_shift_cbuf(fptr, (int)cnt - i, NULL);
|
io_shift_cbuf(fptr, (int)cnt - i, NULL);
|
||||||
}
|
}
|
||||||
v = fill_cbuf(fptr, 0);
|
} while (more_char(fptr) != MORE_CHAR_FINISHED);
|
||||||
if (v != MORE_CHAR_SUSPENDED && v != MORE_CHAR_FINISHED)
|
|
||||||
rb_exc_raise(v);
|
|
||||||
} while (v == MORE_CHAR_SUSPENDED);
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user