make it prefer the drivername subdir if it exists when saving

This commit is contained in:
radius 2015-07-10 23:07:44 -05:00
parent 25d2f2a45f
commit b698e434f5

View File

@ -2350,13 +2350,21 @@ bool config_save_autoconf_profile(const char *path, unsigned user)
settings_t *settings = config_get_ptr();
fill_pathname_join(buf, settings->input.autoconfig_dir,
input.joypad_driver, sizeof(buf));
if(!path_is_directory(buf))
settings->input.joypad_driver, sizeof(buf));
if(path_is_directory(buf))
{
fill_pathname_join(buf, buf,
path, sizeof(buf));
fill_pathname_noext(autoconf_file, buf, ".cfg", sizeof(autoconf_file));
}
else
{
fill_pathname_join(buf, settings->input.autoconfig_dir,
path, sizeof(buf));
fill_pathname_noext(autoconf_file, buf, ".cfg", sizeof(autoconf_file));
fill_pathname_noext(autoconf_file, buf, ".cfg", sizeof(autoconf_file));
}
conf = config_file_new(autoconf_file);