From f1186ff01cf0a39e6403139937003bdf40b71a57 Mon Sep 17 00:00:00 2001 From: "Christopher J. Gilbert" Date: Tue, 21 Apr 2015 03:24:19 -0400 Subject: [PATCH] Autoconfigure - Change equals to starts with ident This allows for Bluetooth PS3 controllers (and other bluetooth controllers) to be automatically detected. In the input_try_autoconfigure_joypad_from_conf function, there is a string comparision between the input's name "params->name" and the configuration's name "ident". Specifically on Bluetooth controllers, the uuid is appended to the end of the name. This enhancement will change the checking for name match from an equals comparision, to a startswith. --- input/input_autodetect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 88ac9346ad..1dfbd30969 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -89,8 +89,8 @@ static bool input_try_autoconfigure_joypad_from_conf(config_file_t *conf, ret = true; } - - if (!strcmp(ident, params->name)) + /* Check for name match - name starts with ident */ + if (!strncmp(params->name, ident, strlen(ident))) { BIT32_SET(*match, AUTODETECT_MATCH_IDENT); ret = true;