diff options
Diffstat (limited to 'ext/stringio/stringio.c')
-rw-r--r-- | ext/stringio/stringio.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/ext/stringio/stringio.c b/ext/stringio/stringio.c index ed141dda64..89cc392122 100644 --- a/ext/stringio/stringio.c +++ b/ext/stringio/stringio.c @@ -1359,20 +1359,17 @@ static VALUE strio_read_nonblock(int argc, VALUE *argv, VALUE self) { VALUE opts = Qnil, val; - int no_exception = 0; rb_scan_args(argc, argv, "11:", NULL, NULL, &opts); if (!NIL_P(opts)) { argc--; - - if (Qfalse == rb_hash_aref(opts, sym_exception)) - no_exception = 1; } val = strio_read(argc, argv, self); if (NIL_P(val)) { - if (no_exception) + if (!NIL_P(opts) && + rb_hash_lookup2(opts, sym_exception, Qundef) == Qfalse) return Qnil; else rb_eof_error(); |