diff --git a/file_path_special.c b/file_path_special.c index 92efc533a7..7f67fd7682 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -270,6 +270,15 @@ void fill_pathname_application_special(char *s, size_t len, enum application_spe { switch (type) { + case APPLICATION_SPECIAL_DIRECTORY_AUTOCONFIG: + { + settings_t *settings = config_get_ptr(); + fill_pathname_join(s, + settings->directory.autoconfig, + settings->input.joypad_driver, + len); + } + break; case APPLICATION_SPECIAL_DIRECTORY_ASSETS_ZARCH_ICONS: #ifdef HAVE_ZARCH { diff --git a/file_path_special.h b/file_path_special.h index d7b0e37f1e..b35c2b6529 100644 --- a/file_path_special.h +++ b/file_path_special.h @@ -25,6 +25,7 @@ enum application_special_type { APPLICATION_SPECIAL_NONE = 0, + APPLICATION_SPECIAL_DIRECTORY_AUTOCONFIG, APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI, APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_FONT, APPLICATION_SPECIAL_DIRECTORY_ASSETS_MATERIALUI_ICONS, diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 48556bd676..c860578236 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -26,6 +26,7 @@ #include "input_autodetect.h" #include "../configuration.h" +#include "../file_path_special.h" #include "../list_special.h" #include "../runloop.h" #include "../verbosity.h" @@ -213,19 +214,15 @@ static bool input_autoconfigure_joypad_from_conf_dir( int current_best = 0; config_file_t *conf = NULL; struct string_list *list = NULL; - settings_t *settings = config_get_ptr(); - if (!settings) - return false; + fill_pathname_application_special(path, sizeof(path), + APPLICATION_SPECIAL_DIRECTORY_AUTOCONFIG); - fill_pathname_join(path, - settings->directory.autoconfig, - settings->input.joypad_driver, - sizeof(path)); list = dir_list_new_special(path, DIR_LIST_AUTOCONFIG, "cfg"); if (!list || !list->size) { + settings_t *settings = config_get_ptr(); if (list) string_list_free(list); list = dir_list_new_special(settings->directory.autoconfig,