Cleanup menu_content_find_first_core

This commit is contained in:
twinaphex 2016-05-27 04:41:39 +02:00
parent a743c779f8
commit e41efa9849
1 changed files with 21 additions and 13 deletions

View File

@ -134,22 +134,30 @@ static bool menu_content_find_first_core(menu_content_ctx_defer_info_t *def_info
(core_info_list_t*)def_info->data : NULL; (core_info_list_t*)def_info->data : NULL;
uint32_t menu_label_hash = uint32_t menu_label_hash =
menu_hash_calculate(def_info->menu_label); menu_hash_calculate(def_info->menu_label);
const char *default_info_dir = def_info ?
def_info->dir : NULL;
if ( !string_is_empty(def_info->dir) if (!string_is_empty(default_info_dir))
&& !string_is_empty(def_info->path)) {
const char *default_info_path = def_info->path;
size_t default_info_length = def_info->len;
if (!string_is_empty(default_info_path))
fill_pathname_join(def_info->s, fill_pathname_join(def_info->s,
def_info->dir, def_info->path, def_info->len); default_info_dir, default_info_path,
default_info_length);
#ifdef HAVE_COMPRESSION #ifdef HAVE_COMPRESSION
if ( !string_is_empty(def_info->dir) if (path_is_compressed_file(default_info_dir))
&& path_is_compressed_file(def_info->dir))
{ {
size_t len = strlen(default_info_dir);
/* In case of a compressed archive, we have to join with a hash */ /* In case of a compressed archive, we have to join with a hash */
/* We are going to write at the position of dir: */ /* We are going to write at the position of dir: */
retro_assert(strlen(def_info->dir) < strlen(def_info->s)); retro_assert(len < strlen(def_info->s));
def_info->s[strlen(def_info->dir)] = '#'; def_info->s[len] = '#';
} }
#endif #endif
}
if (core_info) if (core_info)
core_info_list_get_supported_cores(core_info, core_info_list_get_supported_cores(core_info,