diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-24 09:40:31 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-24 09:40:31 +0000 |
commit | 071319fde18d319cf5c66702aeaf66ca1a880a2f (patch) | |
tree | 765e064f24cabc75e34e456e8d4f443fd1dff9b1 /transcode.c | |
parent | 571b114708061819db35ad7c0349502196aa92be (diff) | |
download | ruby-071319fde18d319cf5c66702aeaf66ca1a880a2f.tar.gz |
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@18817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'transcode.c')
-rw-r--r-- | transcode.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/transcode.c b/transcode.c index 34a61c3363..15755a07c8 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 |