1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[ruby/stringio] Allow bignum mode

d28927b561
This commit is contained in:
Nobuyoshi Nakada 2019-08-14 10:42:14 +09:00
parent e54d349a01
commit 8b44307894
No known key found for this signature in database
GPG key ID: 4BC7D6DF58D8DF60

View file

@ -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 {