mirror of
https://github.com/libretro/RetroArch
synced 2025-03-22 07:21:15 +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);
|
delim = path_get_archive_delim(userdata->archive_path);
|
||||||
|
|
||||||
if (delim)
|
if (delim)
|
||||||
|
{
|
||||||
strlcpy(wanted_file, delim + 1, sizeof(wanted_file));
|
strlcpy(wanted_file, delim + 1, sizeof(wanted_file));
|
||||||
|
|
||||||
if (!string_is_equal_noncase(userdata->extracted_file_path,
|
if (!string_is_equal_noncase(userdata->extracted_file_path,
|
||||||
wanted_file))
|
wanted_file))
|
||||||
return 1; /* keep searching for the right 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,
|
if (file_archive_perform_mode(new_path,
|
||||||
valid_exts, cdata, cmode, csize, size,
|
valid_exts, cdata, cmode, csize, size,
|
||||||
|
@ -427,20 +427,28 @@ static bool init_content_file_extract(
|
|||||||
{
|
{
|
||||||
char temp_content[PATH_MAX_LENGTH] = {0};
|
char temp_content[PATH_MAX_LENGTH] = {0};
|
||||||
char new_path[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;
|
const char *valid_ext = system->info.valid_extensions;
|
||||||
|
|
||||||
/* Block extract check. */
|
/* Block extract check. */
|
||||||
if (content->elems[i].attr.i & 1)
|
if (block_extract)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
compressed = path_contains_compressed_file(content->elems[i].data);
|
contains_compressed = path_contains_compressed_file(content->elems[i].data);
|
||||||
|
|
||||||
if (special)
|
if (special)
|
||||||
valid_ext = special->roms[i].valid_extensions;
|
valid_ext = special->roms[i].valid_extensions;
|
||||||
|
|
||||||
if (!compressed)
|
if (!contains_compressed)
|
||||||
|
{
|
||||||
|
if (path_is_compressed_file(content->elems[i].data))
|
||||||
|
{
|
||||||
|
/* just use the first file in the archive */
|
||||||
|
}
|
||||||
|
else
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
strlcpy(temp_content, content->elems[i].data,
|
strlcpy(temp_content, content->elems[i].data,
|
||||||
sizeof(temp_content));
|
sizeof(temp_content));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user