Update core_info.c

This commit is contained in:
twinaphex 2017-02-28 11:16:05 +01:00
parent 6396f0391a
commit 57e0e30600

View File

@ -840,7 +840,7 @@ bool core_info_database_supports_content_path(const char *database_path, const c
new_path = path_basename(database_path);
if (!string_is_empty(new_path))
database = strdup(new_path);
database = strdup(new_path);
if (!string_is_empty(database))
path_remove_extension(database);
@ -850,6 +850,9 @@ bool core_info_database_supports_content_path(const char *database_path, const c
if (delim)
archive_path = delim - 1;
if (string_is_empty(database))
return false;
/* if the path contains a compressed file and the core supports archives,
* we don't want to look at this file */
if (archive_path)
@ -865,8 +868,7 @@ bool core_info_database_supports_content_path(const char *database_path, const c
&& !string_list_find_elem(info->supported_extensions_list, "7z"))
continue;
free(database);
return false;
goto error;
}
}
@ -877,16 +879,16 @@ bool core_info_database_supports_content_path(const char *database_path, const c
if (!info || !string_list_find_elem(info->supported_extensions_list, path_get_extension(path)))
continue;
if (!string_is_empty(database) || !string_list_find_elem(info->databases_list, database))
if (!string_list_find_elem(info->databases_list, database))
continue;
free(database);
return true;
}
if (!string_is_empty(database))
free(database);
error:
free(database);
return false;
}