From 69179826860d597e7d35435bbce89cf363135ed9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 27 Mar 2015 17:39:11 +0100 Subject: [PATCH] Cleanup input_try_autoconfig_joypad --- input/input_autodetect.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 2f24ab3467..dafe4a8420 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -43,7 +43,6 @@ static bool input_try_autoconfigure_joypad_from_conf(config_file_t *conf, { char ident[PATH_MAX_LENGTH], ident_idx[PATH_MAX_LENGTH]; char input_driver[PATH_MAX_LENGTH]; - bool cond_found_idx, cond_found_general; int input_vid = 0, input_pid = 0; if (!conf) @@ -59,10 +58,6 @@ static bool input_try_autoconfigure_joypad_from_conf(config_file_t *conf, snprintf(ident_idx, sizeof(ident_idx), "%s_p%u", ident, params->idx); - cond_found_idx = !strcmp(ident_idx, params->name); - cond_found_general = !strcmp(ident, params->name) - && !strcmp(params->driver, input_driver); - /* If Vendor ID and Product ID matches, we've found our * entry. */ if ( (params->vid == input_vid) @@ -74,7 +69,10 @@ static bool input_try_autoconfigure_joypad_from_conf(config_file_t *conf, return true; /* Check for name match. */ - if (cond_found_idx || cond_found_general) + if (!strcmp(ident_idx, params->name)) + return true; + if (!strcmp(ident, params->name) + && !strcmp(params->driver, input_driver)) return true; return false;