mirror of
https://github.com/libretro/RetroArch.git
synced 2025-02-17 07:58:55 +00:00
use first extracted file if one is not specified and !need_fullpath and !block_extract
This commit is contained in:
parent
34944cac0f
commit
d493273bcf
@ -248,11 +248,15 @@ static int file_archive_extract_cb(const char *name, const char *valid_exts,
|
||||
delim = path_get_archive_delim(userdata->archive_path);
|
||||
|
||||
if (delim)
|
||||
{
|
||||
strlcpy(wanted_file, delim + 1, sizeof(wanted_file));
|
||||
|
||||
if (!string_is_equal_noncase(userdata->extracted_file_path,
|
||||
wanted_file))
|
||||
return 1; /* keep searching for the right file */
|
||||
if (!string_is_equal_noncase(userdata->extracted_file_path,
|
||||
wanted_file))
|
||||
return 1; /* keep searching for the right file */
|
||||
}
|
||||
else
|
||||
strlcpy(wanted_file, userdata->archive_path, sizeof(wanted_file));
|
||||
|
||||
if (file_archive_perform_mode(new_path,
|
||||
valid_exts, cdata, cmode, csize, size,
|
||||
|
@ -427,20 +427,28 @@ static bool init_content_file_extract(
|
||||
{
|
||||
char temp_content[PATH_MAX_LENGTH] = {0};
|
||||
char new_path[PATH_MAX_LENGTH] = {0};
|
||||
bool compressed = NULL;
|
||||
bool contains_compressed = NULL;
|
||||
bool block_extract = content->elems[i].attr.i & 1;
|
||||
const char *valid_ext = system->info.valid_extensions;
|
||||
|
||||
/* Block extract check. */
|
||||
if (content->elems[i].attr.i & 1)
|
||||
if (block_extract)
|
||||
continue;
|
||||
|
||||
compressed = path_contains_compressed_file(content->elems[i].data);
|
||||
contains_compressed = path_contains_compressed_file(content->elems[i].data);
|
||||
|
||||
if (special)
|
||||
valid_ext = special->roms[i].valid_extensions;
|
||||
|
||||
if (!compressed)
|
||||
continue;
|
||||
if (!contains_compressed)
|
||||
{
|
||||
if (path_is_compressed_file(content->elems[i].data))
|
||||
{
|
||||
/* just use the first file in the archive */
|
||||
}
|
||||
else
|
||||
continue;
|
||||
}
|
||||
|
||||
strlcpy(temp_content, content->elems[i].data,
|
||||
sizeof(temp_content));
|
||||
@ -518,7 +526,7 @@ static bool load_content(
|
||||
/* Load the content into memory. */
|
||||
|
||||
ssize_t len = 0;
|
||||
|
||||
|
||||
if (!load_content_into_memory(i, path, (void**)&info[i].data, &len))
|
||||
{
|
||||
RARCH_ERR("%s \"%s\".\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user