cleanup some duplicate code and make it prefer the drivername subdir if it exists

This commit is contained in:
radius 2015-07-10 22:58:42 -05:00
parent da7a75f0fb
commit 25d2f2a45f

View File

@ -2350,7 +2350,11 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
settings_t *settings = config_get_ptr();
fill_pathname_join(buf, settings->input.autoconfig_dir,
path, sizeof(buf));
input.joypad_driver, sizeof(buf));
if(!path_is_directory(buf))
fill_pathname_join(buf, settings->input.autoconfig_dir,
path, sizeof(buf));
fill_pathname_noext(autoconf_file, buf, ".cfg", sizeof(autoconf_file));