diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-20 11:33:36 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-08-20 11:33:36 +0000 |
commit | c7761bbfa1a0212df9eb49d921eb12b2bc1a241a (patch) | |
tree | 39707e7c5952c7913bc7cf665b71b3169b51e13f /io.c | |
parent | 2d6dfce7182cc8decf58df453b75380efb89700a (diff) | |
download | ruby-c7761bbfa1a0212df9eb49d921eb12b2bc1a241a.tar.gz ruby-c7761bbfa1a0212df9eb49d921eb12b2bc1a241a.tar.xz ruby-c7761bbfa1a0212df9eb49d921eb12b2bc1a241a.zip |
* io.c (rb_io_open_with_args): use rb_open_file instead of rb_io_open.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@18726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 16 |
1 files changed, 4 insertions, 12 deletions
@@ -4807,19 +4807,11 @@ rb_io_open(const char *fname, const char *mode) static VALUE rb_io_open_with_args(int argc, VALUE *argv) { - const char *mode; - VALUE pname, pmode; + VALUE io; - if (rb_scan_args(argc, argv, "11", &pname, &pmode) == 1) { - mode = "r"; - } - else if (FIXNUM_P(pmode)) { - mode = rb_io_modenum_mode(FIX2INT(pmode)); - } - else { - mode = StringValueCStr(pmode); - } - return rb_io_open(StringValueCStr(pname), mode); + io = io_alloc(rb_cFile); + rb_open_file(argc, argv, io); + return io; } static VALUE |