Prefer config_file_read instead of config_file_new when we are

sure the path cannot be a directory path
This commit is contained in:
twinaphex 2019-04-22 01:23:50 +02:00
parent 69168ec6bc
commit 16e2db25c4
3 changed files with 14 additions and 13 deletions

View File

@ -833,7 +833,7 @@ void core_info_get_name(const char *path, char *s, size_t len,
continue;
}
conf = config_file_new(info_path);
conf = config_file_read(info_path);
if (!conf)
{
@ -985,7 +985,7 @@ bool core_info_get_display_name(const char *path, char *s, size_t len)
{
bool ret = true;
char *tmp = NULL;
config_file_t *conf = config_file_new(path);
config_file_t *conf = config_file_read(path);
if (!conf)
{

View File

@ -2702,7 +2702,8 @@ static int action_ok_core_deferred_set(const char *new_core_path,
{
struct playlist_entry entry = {0};
/* the update function reads our entry as const, so these casts are safe */
/* the update function reads our entry
* as const, so these casts are safe */
entry.label = (char*)content_label;
entry.core_path = (char*)new_core_path;
entry.core_name = core_display_name;

View File

@ -359,7 +359,7 @@ static bool input_autoconfigure_joypad_from_conf_dir(
for (i = 0; i < list->size; i++)
{
conf = config_file_new(list->elems[i].data);
conf = config_file_read(list->elems[i].data);
if (conf)
ret = input_autoconfigure_joypad_try_from_conf(conf, params);
@ -374,7 +374,7 @@ static bool input_autoconfigure_joypad_from_conf_dir(
if (index >= 0 && current_best > 0)
{
conf = config_file_new(list->elems[index].data);
conf = config_file_read(list->elems[index].data);
if (conf)
{