From fd7e737216dfdcecd4522b7d8c8dd2439d3dac3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 12 Jul 2022 11:44:37 +0200 Subject: [PATCH] Linux: Fix duplicate joystick objects This fixes a regression introduced by 2c204ab52ecaa51bfd32b777aef715dae937f009. This broke the check for whether there is already a GLFW joystick object for a given input device, making it always fail. --- src/linux_joystick.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/linux_joystick.c b/src/linux_joystick.c index b8b5778e..fd5dabdf 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c @@ -128,7 +128,7 @@ static GLFWbool openJoystickDevice(const char* path) { for (int jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { - if (_glfw.joysticks[jid].connected) + if (!_glfw.joysticks[jid].connected) continue; if (strcmp(_glfw.joysticks[jid].linjs.path, path) == 0) return GLFW_FALSE;