mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
(core_info.c) Small opts for core_info.c
This commit is contained in:
parent
ac2fec7298
commit
5044537625
21
core_info.c
21
core_info.c
@ -784,14 +784,13 @@ void core_info_get_name(const char *path, char *s, size_t len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
conf = config_file_read(info_path);
|
conf = config_file_read(info_path);
|
||||||
|
free(info_path);
|
||||||
|
|
||||||
if (!conf)
|
if (!conf)
|
||||||
{
|
|
||||||
free(info_path);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
if (config_get_string(conf, get_display_name ? "display_name" : "corename",
|
if (config_get_string(conf, get_display_name
|
||||||
|
? "display_name" : "corename",
|
||||||
&new_core_name))
|
&new_core_name))
|
||||||
{
|
{
|
||||||
strlcpy(s, new_core_name, len);
|
strlcpy(s, new_core_name, len);
|
||||||
@ -799,12 +798,10 @@ void core_info_get_name(const char *path, char *s, size_t len,
|
|||||||
}
|
}
|
||||||
|
|
||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
free(info_path);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (contents)
|
dir_list_free(contents);
|
||||||
dir_list_free(contents);
|
|
||||||
contents = NULL;
|
contents = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -933,15 +930,11 @@ bool core_info_list_get_display_name(core_info_list_t *core_info_list,
|
|||||||
|
|
||||||
bool core_info_get_display_name(const char *path, char *s, size_t len)
|
bool core_info_get_display_name(const char *path, char *s, size_t len)
|
||||||
{
|
{
|
||||||
bool ret = true;
|
|
||||||
char *tmp = NULL;
|
char *tmp = NULL;
|
||||||
config_file_t *conf = config_file_read(path);
|
config_file_t *conf = config_file_read(path);
|
||||||
|
|
||||||
if (!conf)
|
if (!conf)
|
||||||
{
|
return false;
|
||||||
ret = false;
|
|
||||||
goto error;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config_get_string(conf, "display_name", &tmp))
|
if (config_get_string(conf, "display_name", &tmp))
|
||||||
{
|
{
|
||||||
@ -949,8 +942,6 @@ bool core_info_get_display_name(const char *path, char *s, size_t len)
|
|||||||
free(tmp);
|
free(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
error:
|
|
||||||
config_file_free(conf);
|
config_file_free(conf);
|
||||||
|
return true;
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user