[ruby/reline] 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

https://github.com/ruby/reline/commit/e66a9696a1
This commit is contained in:
HASUMI Hitoshi 2022-11-29 10:06:50 +09:00 committed by git
parent 21ed929e15
commit 11871e49c4

View File

@ -150,7 +150,7 @@ class Reline::ANSI
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