From e66a9696a1677dd137190398a2e9a4c02892df16 Mon Sep 17 00:00:00 2001 From: HASUMI Hitoshi Date: Tue, 29 Nov 2022 10:06:50 +0900 Subject: [PATCH] Fix misuse of kwarg in IO#raw - Obviously, `tim` is a typo for `time` - This didn't cause an exception because IO#raw is implemented in C and it doesn't check the keyword of the parameters - Though this typo doesn't produce any problems for now, I think it should be fixed just in case for the future - I've used this fixed version of Reline with IRB for several days and didn't find any new problems due to the fix - But I myself am not sure how to make sure this fix is completely robust --- lib/reline/ansi.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/reline/ansi.rb b/lib/reline/ansi.rb index ab147a6185..c40085e50d 100644 --- a/lib/reline/ansi.rb +++ b/lib/reline/ansi.rb @@ -150,7 +150,7 @@ def self.inner_getc until c = @@input.raw(intr: true) { @@input.wait_readable(0.1) && @@input.getbyte } Reline.core.line_editor.resize end - (c == 0x16 && @@input.raw(min: 0, tim: 0, &:getbyte)) || c + (c == 0x16 && @@input.raw(min: 0, time: 0, &:getbyte)) || c rescue Errno::EIO # Maybe the I/O has been closed. nil