use fill_pathname_join_concat if we want to set a filename path
with extension instead of doing fill_pathname_join and then fill_pathname_noext
This commit is contained in:
parent
116bf8058a
commit
fc5b557a10
|
@ -140,7 +140,6 @@ bool cheat_manager_save(
|
||||||
{
|
{
|
||||||
bool ret;
|
bool ret;
|
||||||
unsigned i;
|
unsigned i;
|
||||||
char buf[PATH_MAX_LENGTH];
|
|
||||||
char cheats_file[PATH_MAX_LENGTH];
|
char cheats_file[PATH_MAX_LENGTH];
|
||||||
config_file_t *conf = NULL;
|
config_file_t *conf = NULL;
|
||||||
cheat_manager_t *cheat_st = &cheat_manager_state;
|
cheat_manager_t *cheat_st = &cheat_manager_state;
|
||||||
|
@ -164,7 +163,7 @@ bool cheat_manager_save(
|
||||||
(char*)"cheat%u_repeat_add_to_address"
|
(char*)"cheat%u_repeat_add_to_address"
|
||||||
};
|
};
|
||||||
|
|
||||||
buf[0] = cheats_file[0] = '\0';
|
cheats_file[0] = '\0';
|
||||||
|
|
||||||
if (!cheat_st->cheats || cheat_st->size == 0)
|
if (!cheat_st->cheats || cheat_st->size == 0)
|
||||||
return false;
|
return false;
|
||||||
|
@ -172,11 +171,10 @@ bool cheat_manager_save(
|
||||||
if (!cheat_database)
|
if (!cheat_database)
|
||||||
strlcpy(cheats_file, path, sizeof(cheats_file));
|
strlcpy(cheats_file, path, sizeof(cheats_file));
|
||||||
else
|
else
|
||||||
{
|
fill_pathname_join_concat(cheats_file,
|
||||||
fill_pathname_join(buf, cheat_database, path, sizeof(buf));
|
cheat_database, path,
|
||||||
|
".cht",
|
||||||
fill_pathname_noext(cheats_file, buf, ".cht", sizeof(cheats_file));
|
sizeof(cheats_file));
|
||||||
}
|
|
||||||
|
|
||||||
if (!overwrite)
|
if (!overwrite)
|
||||||
conf = config_file_new_from_path_to_string(cheats_file);
|
conf = config_file_new_from_path_to_string(cheats_file);
|
||||||
|
|
|
@ -3946,23 +3946,11 @@ bool config_save_autoconf_profile(const
|
||||||
fill_pathname_join(buf, autoconf_dir, joypad_driver, sizeof(buf));
|
fill_pathname_join(buf, autoconf_dir, joypad_driver, sizeof(buf));
|
||||||
|
|
||||||
if (path_is_directory(buf))
|
if (path_is_directory(buf))
|
||||||
{
|
fill_pathname_join_concat(autoconf_file, buf,
|
||||||
char buf_new[PATH_MAX_LENGTH];
|
sanitised_name, ".cfg", sizeof(autoconf_file));
|
||||||
|
|
||||||
buf_new[0] = '\0';
|
|
||||||
|
|
||||||
fill_pathname_join(buf_new, buf,
|
|
||||||
sanitised_name, sizeof(buf_new));
|
|
||||||
fill_pathname_noext(autoconf_file,
|
|
||||||
buf_new, ".cfg", sizeof(autoconf_file));
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
fill_pathname_join_concat(autoconf_file, autoconf_dir,
|
||||||
fill_pathname_join(buf, autoconf_dir,
|
sanitised_name, ".cfg", sizeof(autoconf_file));
|
||||||
sanitised_name, sizeof(buf));
|
|
||||||
fill_pathname_noext(autoconf_file,
|
|
||||||
buf, ".cfg", sizeof(autoconf_file));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Open config file */
|
/* Open config file */
|
||||||
conf = config_file_new_from_path_to_string(autoconf_file);
|
conf = config_file_new_from_path_to_string(autoconf_file);
|
||||||
|
@ -4637,7 +4625,6 @@ bool input_remapping_save_file(const char *path)
|
||||||
{
|
{
|
||||||
bool ret;
|
bool ret;
|
||||||
unsigned i, j;
|
unsigned i, j;
|
||||||
char buf[PATH_MAX_LENGTH];
|
|
||||||
char remap_file[PATH_MAX_LENGTH];
|
char remap_file[PATH_MAX_LENGTH];
|
||||||
char key_strings[RARCH_FIRST_CUSTOM_BIND + 8][8] = {
|
char key_strings[RARCH_FIRST_CUSTOM_BIND + 8][8] = {
|
||||||
"b", "y", "select", "start",
|
"b", "y", "select", "start",
|
||||||
|
@ -4649,11 +4636,11 @@ bool input_remapping_save_file(const char *path)
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
const char *dir_input_remapping = settings->paths.directory_input_remapping;
|
const char *dir_input_remapping = settings->paths.directory_input_remapping;
|
||||||
|
|
||||||
buf[0] = remap_file[0] = '\0';
|
remap_file[0] = '\0';
|
||||||
|
|
||||||
fill_pathname_join(buf, dir_input_remapping, path, sizeof(buf));
|
fill_pathname_join_concat(remap_file, dir_input_remapping, path,
|
||||||
fill_pathname_noext(remap_file, buf,
|
FILE_PATH_REMAP_EXTENSION,
|
||||||
FILE_PATH_REMAP_EXTENSION, sizeof(remap_file));
|
sizeof(remap_file));
|
||||||
|
|
||||||
if (!(conf = config_file_new_from_path_to_string(remap_file)))
|
if (!(conf = config_file_new_from_path_to_string(remap_file)))
|
||||||
{
|
{
|
||||||
|
@ -4743,15 +4730,11 @@ bool input_remapping_save_file(const char *path)
|
||||||
bool input_remapping_remove_file(const char *path,
|
bool input_remapping_remove_file(const char *path,
|
||||||
const char *dir_input_remapping)
|
const char *dir_input_remapping)
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX_LENGTH];
|
|
||||||
char remap_file[PATH_MAX_LENGTH];
|
char remap_file[PATH_MAX_LENGTH];
|
||||||
buf[0] = remap_file[0] = '\0';
|
remap_file[0] = '\0';
|
||||||
|
fill_pathname_join_concat(remap_file, dir_input_remapping, path,
|
||||||
fill_pathname_join(buf, dir_input_remapping, path, sizeof(buf));
|
|
||||||
fill_pathname_noext(remap_file, buf,
|
|
||||||
FILE_PATH_REMAP_EXTENSION,
|
FILE_PATH_REMAP_EXTENSION,
|
||||||
sizeof(remap_file));
|
sizeof(remap_file));
|
||||||
|
|
||||||
return filestream_delete(remap_file) == 0 ? true : false;
|
return filestream_delete(remap_file) == 0 ? true : false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue