From 71428ac2645400c02b0ee56b0ff7021542b9616f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 10 Oct 2020 22:11:01 +0900 Subject: [ruby/io-console] Refined getch warnings https://github.com/ruby/io-console/commit/f84e6abcce --- ext/io/console/console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ext/io') diff --git a/ext/io/console/console.c b/ext/io/console/console.c index 7d5181cfb3..ff4df73693 100644 --- a/ext/io/console/console.c +++ b/ext/io/console/console.c @@ -544,7 +544,7 @@ console_getch(int argc, VALUE *argv, VALUE io) if (optp->vtime) break; /* fallthru */ default: - rb_warning("min option ignored"); + rb_warning("min option larger than 1 ignored"); } if (optp->intr) { # ifndef HAVE_RB_IO_WAIT @@ -556,8 +556,8 @@ console_getch(int argc, VALUE *argv, VALUE io) if (result == Qfalse) return Qnil; # endif } - else { - rb_warning("vtime option ignored if intr flag is unset"); + else if (optp->vtime) { + rb_warning("Non-zero vtime option ignored if intr flag is unset"); } } len = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getch, wbuf, RUBY_UBF_IO, 0); -- cgit v1.2.3