mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(task_content.c) Minor cleanups
This commit is contained in:
parent
52c2e1a501
commit
a5c52dcc07
@ -428,13 +428,14 @@ static bool content_file_init_extract(
|
|||||||
char new_path[PATH_MAX_LENGTH];
|
char new_path[PATH_MAX_LENGTH];
|
||||||
bool contains_compressed = NULL;
|
bool contains_compressed = NULL;
|
||||||
bool block_extract = content->elems[i].attr.i & 1;
|
bool block_extract = content->elems[i].attr.i & 1;
|
||||||
|
const char *path = content->elems[i].data;
|
||||||
const char *valid_ext = content_ctx->valid_extensions;
|
const char *valid_ext = content_ctx->valid_extensions;
|
||||||
|
|
||||||
/* Block extract check. */
|
/* Block extract check. */
|
||||||
if (block_extract)
|
if (block_extract)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
contains_compressed = path_contains_compressed_file(content->elems[i].data);
|
contains_compressed = path_contains_compressed_file(path);
|
||||||
|
|
||||||
if (special)
|
if (special)
|
||||||
valid_ext = special->roms[i].valid_extensions;
|
valid_ext = special->roms[i].valid_extensions;
|
||||||
@ -442,14 +443,13 @@ static bool content_file_init_extract(
|
|||||||
if (!contains_compressed)
|
if (!contains_compressed)
|
||||||
{
|
{
|
||||||
/* just use the first file in the archive */
|
/* just use the first file in the archive */
|
||||||
if (!path_is_compressed_file(content->elems[i].data))
|
if (!path_is_compressed_file(path))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
temp_content[0] = new_path[0] = '\0';
|
temp_content[0] = new_path[0] = '\0';
|
||||||
|
|
||||||
strlcpy(temp_content, content->elems[i].data,
|
strlcpy(temp_content, path, sizeof(temp_content));
|
||||||
sizeof(temp_content));
|
|
||||||
|
|
||||||
if (!valid_ext || !file_archive_extract_file(temp_content,
|
if (!valid_ext || !file_archive_extract_file(temp_content,
|
||||||
sizeof(temp_content), valid_ext,
|
sizeof(temp_content), valid_ext,
|
||||||
@ -575,10 +575,11 @@ static bool content_file_load(
|
|||||||
if (!special)
|
if (!special)
|
||||||
{
|
{
|
||||||
const void *load_data = NULL;
|
const void *load_data = NULL;
|
||||||
|
const char *path = content->elems[0].data;
|
||||||
|
|
||||||
cheevos_set_cheats();
|
cheevos_set_cheats();
|
||||||
|
|
||||||
if (!string_is_empty(content->elems[0].data))
|
if (!string_is_empty(path))
|
||||||
load_data = info;
|
load_data = info;
|
||||||
cheevos_load(load_data);
|
cheevos_load(load_data);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user