зеркало из https://github.com/github/ruby.git
* io.c (io_enc_str): code conversion removed.
(io_enc_str_converted): removed because it is identical to io_enc_str now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
6f1fe004f7
Коммит
08dcd12235
|
@ -1,3 +1,9 @@
|
|||
Mon Aug 18 12:45:24 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* io.c (io_enc_str): code conversion removed.
|
||||
(io_enc_str_converted): removed because it is identical to
|
||||
io_enc_str now.
|
||||
|
||||
Mon Aug 18 12:12:29 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* io.c (io_shift_crbuf): add strp argument to append into existing
|
||||
|
|
22
io.c
22
io.c
|
@ -1382,24 +1382,6 @@ remain_size(rb_io_t *fptr)
|
|||
|
||||
static VALUE
|
||||
io_enc_str(VALUE str, rb_io_t *fptr)
|
||||
{
|
||||
OBJ_TAINT(str);
|
||||
if (fptr->enc2) {
|
||||
/* two encodings, so transcode from enc2 to enc */
|
||||
/* the methods in transcode.c are static, so call indirectly */
|
||||
str = rb_funcall(str, id_encode, 2,
|
||||
rb_enc_from_encoding(fptr->enc),
|
||||
rb_enc_from_encoding(fptr->enc2));
|
||||
}
|
||||
else {
|
||||
/* just one encoding, so associate it with the string */
|
||||
rb_enc_associate(str, io_read_encoding(fptr));
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
static VALUE
|
||||
io_enc_str_converted(VALUE str, rb_io_t *fptr)
|
||||
{
|
||||
OBJ_TAINT(str);
|
||||
rb_enc_associate(str, io_read_encoding(fptr));
|
||||
|
@ -1526,7 +1508,7 @@ read_all(rb_io_t *fptr, long siz, VALUE str)
|
|||
io_shift_crbuf(fptr, fptr->crbuf_len, &str);
|
||||
}
|
||||
if (more_char(fptr) == -1) {
|
||||
return io_enc_str_converted(str, fptr);
|
||||
return io_enc_str(str, fptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2147,7 +2129,7 @@ rb_io_getline_1(VALUE rs, long limit, VALUE io)
|
|||
}
|
||||
}
|
||||
if (!NIL_P(str))
|
||||
str = io_enc_str_converted(str, fptr);
|
||||
str = io_enc_str(str, fptr);
|
||||
}
|
||||
|
||||
if (!NIL_P(str)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче