mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
e54d349a01
commit
8b44307894
1 changed files with 3 additions and 2 deletions
|
@ -33,14 +33,15 @@ strio_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash,
|
|||
int *oflags_p, int *fmode_p, struct rb_io_enc_t *convconfig_p)
|
||||
{
|
||||
VALUE mode = *vmode_p;
|
||||
VALUE intmode;
|
||||
int fmode;
|
||||
|
||||
convconfig_p->enc = convconfig_p->enc2 = 0;
|
||||
if (NIL_P(mode)) {
|
||||
fmode = FMODE_READABLE;
|
||||
}
|
||||
else if (FIXNUM_P(mode)) {
|
||||
int flags = FIX2INT(mode);
|
||||
else if (!NIL_P(intmode = rb_check_to_integer(mode, "to_int"))) {
|
||||
int flags = NUM2INT(intmode);
|
||||
fmode = rb_io_oflags_fmode(flags);
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue