summaryrefslogtreecommitdiff
path: root/ext/io/console
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2020-10-10 22:11:01 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2020-10-11 02:00:28 +0900
commit71428ac2645400c02b0ee56b0ff7021542b9616f (patch)
treea03c40ab767b291d3c80d77f7ad3c8b24c1c5066 /ext/io/console
parent37259e878f05db4106b67a9fc9cdc426d174282c (diff)
[ruby/io-console] Refined getch warnings
https://github.com/ruby/io-console/commit/f84e6abcce
Diffstat (limited to 'ext/io/console')
-rw-r--r--ext/io/console/console.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/io/console/console.c b/ext/io/console/console.c
index 7d5181c..ff4df73 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);