diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/io/console/console.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 11ce699971..7d5181cfb3 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -537,7 +537,13 @@ console_getch(int argc, VALUE *argv, VALUE io) timeout = rb_scheduler_timeout(&tv); # endif } - if (optp->vmin != 1) { + switch (optp->vmin) { + case 1: /* default */ + break; + case 0: /* return nil when timed out */ + if (optp->vtime) break; + /* fallthru */ + default: rb_warning("min option ignored"); } if (optp->intr) { |