Create fill_pathname_join_noext

This commit is contained in:
twinaphex 2016-06-28 13:05:46 +02:00
parent 51b2e920fe
commit ca3eecf5c0
5 changed files with 16 additions and 13 deletions

View File

@ -574,6 +574,13 @@ void fill_pathname_join(char *out_path,
retro_assert(strlcat(out_path, path, size) < size);
}
void fill_pathname_join_noext(char *out_path,
const char *dir, const char *path, size_t size)
{
fill_pathname_join(out_path, dir, path, size);
path_remove_extension(out_path);
}
void fill_string_join(char *out_path,
const char *append, size_t size)
{

View File

@ -304,6 +304,9 @@ 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_noext(char *out_path,
const char *dir, const char *path, size_t size);
/**
* fill_string_join:
* @out_path : output path

View File

@ -1033,12 +1033,11 @@ static void xmb_list_switch_new(xmb_handle_t *xmb,
if (tmp)
{
fill_pathname_join(
fill_pathname_join_noext(
path,
settings->directory.dynamic_wallpapers,
tmp,
sizeof(path));
path_remove_extension(path);
free(tmp);
}

View File

@ -114,13 +114,11 @@ static void print_buf_lines(file_list_t *list, char *buf,
char core_path[PATH_MAX_LENGTH] = {0};
char *last = NULL;
fill_pathname_join(
fill_pathname_join_noext(
core_path,
settings->path.libretro_info,
line_start,
sizeof(core_path));
path_remove_extension(core_path);
path_remove_extension(core_path);
last = (char*)strrchr(core_path, '_');
if (*last)
@ -225,14 +223,13 @@ static void print_buf_lines_extended(file_list_t *list, char *buf, int buf_size,
char display_name[PATH_MAX_LENGTH] = {0};
char *last = NULL;
fill_pathname_join(
fill_pathname_join_noext(
core_path,
settings->path.libretro_info,
core_pathname,
sizeof(core_path));
path_remove_extension(core_path);
path_remove_extension(core_path);
path_remove_extension(core_path);
last = (char*)strrchr(core_path, '_');
if (!string_is_empty(last))
{
@ -2754,9 +2751,8 @@ static int menu_displaylist_parse_horizontal_content_actions(
{
char db_path[PATH_MAX_LENGTH] = {0};
fill_pathname_join(db_path, settings->path.content_database,
fill_pathname_join_noext(db_path, settings->path.content_database,
db_name, sizeof(db_path));
path_remove_extension(db_path);
strlcat(db_path, file_path_str(FILE_PATH_RDB_EXTENSION),
sizeof(db_path));

View File

@ -272,11 +272,9 @@ static int database_info_list_iterate_found_match(
database_info_t *db_info_entry = &db_state->info->list[
db_state->entry_index];
fill_short_pathname_representation(db_playlist_base_str,
fill_short_pathname_representation_noext(db_playlist_base_str,
db_path, sizeof(db_playlist_base_str));
path_remove_extension(db_playlist_base_str);
strlcat(db_playlist_base_str,
file_path_str(FILE_PATH_LPL_EXTENSION),
sizeof(db_playlist_base_str));