(task_content.c) Only do strdup when variable is non-empty

This commit is contained in:
twinaphex 2016-12-22 00:42:56 +01:00
parent d39acc3f8e
commit a91e00026b

View File

@ -1389,11 +1389,14 @@ bool content_init(void)
{
content_ctx.history_list_enable = settings->history_list_enable;
content_ctx.set_supports_no_game_enable = settings->set_supports_no_game_enable;
content_ctx.directory_system = strdup(settings->directory.system);
content_ctx.directory_cache = strdup(settings->directory.cache);
if (!string_is_empty(settings->directory.system))
content_ctx.directory_system = strdup(settings->directory.system);
if (!string_is_empty(settings->directory.cache))
content_ctx.directory_cache = strdup(settings->directory.cache);
if (!string_is_empty(sys_info->info.valid_extensions))
content_ctx.valid_extensions = strdup(sys_info->info.valid_extensions);
content_ctx.block_extract = sys_info->info.block_extract;
content_ctx.need_fullpath = sys_info->info.need_fullpath;