summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-21 13:20:43 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-05-21 13:20:43 +0000
commit67cf354b465604d820ea51d4afcc14d681640a19 (patch)
tree7edb345d3303de5fc0ef461937f4bd74829ecaf6 /io.c
parenta04e4ae82b8d28b1fd40834bd12e4584f0695655 (diff)
* io.c (rb_io_extract_modeenc): accept combination hash and
File::Constants. (eg. File.open('yo', :mode => File::WRONLY)) [Feature #4742][ruby-core:36338] * test/ruby/test_io.rb (TestIO#test_open_mode): new test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/io.c b/io.c
index 154a01943b..053c161e53 100644
--- a/io.c
+++ b/io.c
@@ -4458,6 +4458,7 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
/* Set to defaults */
rb_io_ext_int_to_encs(NULL, NULL, &enc, &enc2);
+ vmode_handle:
if (NIL_P(vmode)) {
fmode = FMODE_READABLE | DEFAULT_TEXTMODE;
oflags = O_RDONLY;
@@ -4470,7 +4471,6 @@ rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
else {
const char *p;
- vmode_handle:
SafeStringValue(vmode);
p = StringValueCStr(vmode);
fmode = rb_io_modestr_fmode(p);