From fb2e6dbe840ba348461292f41a33303952790c2c Mon Sep 17 00:00:00 2001 From: akr Date: Sun, 24 Aug 2008 09:40:31 +0000 Subject: * io.c (rb_io_s_pipe): accept optional hash. (rb_io_set_encoding): ditto. (rb_io_extract_modeenc): use rb_econv_opts to initialize ecopts. (rb_file_open_generic): ditto. (rb_file_open_internal): ditto. (io_encoding_set): new argument: opt. (argf_set_encoding): copy fptr->encs.opts to argf_ecopts. * transcode.c (rb_econv_opts): accept Qnil for initialization. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- transcode.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'transcode.c') diff --git a/transcode.c b/transcode.c index 34a61c336..15755a07c 100644 --- a/transcode.c +++ b/transcode.c @@ -1709,7 +1709,10 @@ econv_opts(VALUE opt) void rb_econv_opts(VALUE hash, rb_econv_option_t *opts) { - opts->flags = econv_opts(hash); + if (NIL_P(hash)) + opts->flags = 0; + else + opts->flags = econv_opts(hash); } static int -- cgit