* io.c (argf_external_encoding, argf_internal_encoding): fix SEGV by
ARGF.external_encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
441be3ca06
commit
17248a467e
@ -1,3 +1,8 @@
|
||||
Thu May 29 22:29:39 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* io.c (argf_external_encoding, argf_internal_encoding): fix SEGV by
|
||||
ARGF.external_encoding.
|
||||
|
||||
Wed May 28 18:05:28 2008 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* array.c (rb_ary_nitems, Init_Array): Axe Array#nitems().
|
||||
|
10
io.c
10
io.c
@ -6942,13 +6942,19 @@ rb_io_set_encoding(int argc, VALUE *argv, VALUE io)
|
||||
static VALUE
|
||||
argf_external_encoding(VALUE argf)
|
||||
{
|
||||
return rb_io_external_encoding(current_file);
|
||||
if (!RTEST(current_file)) {
|
||||
return rb_enc_from_encoding(rb_default_external_encoding());
|
||||
}
|
||||
return rb_io_external_encoding(rb_io_check_io(current_file));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
argf_internal_encoding(VALUE argf)
|
||||
{
|
||||
return rb_io_internal_encoding(current_file);
|
||||
if (!RTEST(current_file)) {
|
||||
return rb_enc_from_encoding(rb_default_external_encoding());
|
||||
}
|
||||
return rb_io_internal_encoding(rb_io_check_io(current_file));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
|
Loading…
x
Reference in New Issue
Block a user