From 7b45800ff98955f11e7f0801058bb908d96ede10 Mon Sep 17 00:00:00 2001 From: radius Date: Thu, 9 Jul 2015 23:51:39 -0500 Subject: [PATCH] make it look in the top level directory first, if no profiles look in the driver name subdir --- input/input_autodetect.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index f48d9e999d..14b52dc1eb 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -158,11 +158,20 @@ static bool input_autoconfigure_joypad_from_conf_dir( fill_pathname_join(path,settings->input.autoconfig_dir,settings->input.driver,sizeof(path)); struct string_list *list = settings ? dir_list_new( - path, "cfg", false) : NULL; + settings->input.autoconfig_dir, "cfg", false) : NULL; - if (!list) + if (!list || !list->size) + { + fill_pathname_join(path,settings->input.autoconfig_dir,settings->input.driver,sizeof(path)); + + list = settings ? dir_list_new( + path, "cfg", false) : NULL; + } + + if(!list) return false; + RARCH_LOG("Autoconfig: %d profiles found\n", list->size); config_file_t *conf; for (i = 0; i < list->size; i++)