Create fill_pathname_join_special_ext

This commit is contained in:
twinaphex 2016-06-30 04:59:57 +02:00
parent 5d7367e89a
commit 5f71ecc1d1
3 changed files with 19 additions and 5 deletions

View File

@ -585,6 +585,16 @@ void fill_pathname_join(char *out_path,
retro_assert(strlcat(out_path, path, size) < size);
}
void fill_pathname_join_special_ext(char *out_path,
const char *dir, const char *path,
const char *last, const char *ext,
size_t size)
{
fill_pathname_join(out_path, dir, path, size);
fill_string_join(out_path, last, size);
strlcat(out_path, ext, size);
}
void fill_pathname_join_concat(char *out_path,
const char *dir, const char *path,
const char *concat,

View File

@ -310,6 +310,11 @@ void fill_pathname_resolve_relative(char *out_path, const char *in_refpath,
void fill_pathname_join(char *out_path, const char *dir,
const char *path, size_t size);
void fill_pathname_join_special_ext(char *out_path,
const char *dir, const char *path,
const char *last, const char *ext,
size_t size);
void fill_pathname_join_concat(char *out_path,
const char *dir, const char *path,
const char *concat,

View File

@ -1219,11 +1219,10 @@ bool retroarch_validate_game_options(char *s, size_t len, bool mkdir)
APPLICATION_SPECIAL_DIRECTORY_CONFIG);
/* Concatenate strings into full paths for game_path */
fill_pathname_join(s,
config_directory, core_name, len);
fill_string_join(s, game_name, len);
strlcat(s,
file_path_str(FILE_PATH_OPT_EXTENSION), len);
fill_pathname_join_special_ext(s,
config_directory, core_name, game_name,
file_path_str(FILE_PATH_OPT_EXTENSION),
len);
fill_pathname_join(core_path,
config_directory, core_name, sizeof(core_path));