From 3159548f3ea7ce4cdb172e7df47c662419cbb7ed Mon Sep 17 00:00:00 2001 From: poire-z Date: Sat, 19 Aug 2017 14:39:52 +0200 Subject: [PATCH] Avoid warning on input timeout on the emulator --- frontend/device/input.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/device/input.lua b/frontend/device/input.lua index ddbead342..e352b9f7c 100644 --- a/frontend/device/input.lua +++ b/frontend/device/input.lua @@ -578,7 +578,10 @@ function Input:waitEvent(timeout_us) end -- ev does contain an error message: - if ev == "Waiting for input failed: timeout\n" then + local timeout_err_msg = "Waiting for input failed: timeout\n" + -- ev may not be equal to timeout_err_msg, but it may ends with it + -- ("./ffi/SDL2_0.lua:110: Waiting for input failed: timeout" on the emulator) + if ev and ev.sub and ev:sub(-timeout_err_msg:len()) == timeout_err_msg then -- don't report an error on timeout ev = nil break