mirror of
https://github.com/libretro/RetroArch
synced 2025-04-07 13:23:32 +00:00
Start making tasks_decompress.c suitable for extracting APKs too
This commit is contained in:
parent
a59cee2521
commit
a7e72772e7
@ -129,6 +129,7 @@ bool rarch_task_push_decompress(const char *source_file, const char *target_dir,
|
|||||||
decompress_state_t *s;
|
decompress_state_t *s;
|
||||||
rarch_task_t *t;
|
rarch_task_t *t;
|
||||||
char tmp[PATH_MAX_LENGTH];
|
char tmp[PATH_MAX_LENGTH];
|
||||||
|
bool is_compressed = false;
|
||||||
|
|
||||||
if (!target_dir || !target_dir[0] || !source_file || !source_file[0])
|
if (!target_dir || !target_dir[0] || !source_file || !source_file[0])
|
||||||
{
|
{
|
||||||
@ -136,8 +137,11 @@ bool rarch_task_push_decompress(const char *source_file, const char *target_dir,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* zip only */
|
/* ZIP or APK only */
|
||||||
if (!path_file_exists(source_file) || strcmp("zip", path_get_extension(source_file)) != 0)
|
is_compressed = !strcmp("zip", path_get_extension(source_file));
|
||||||
|
is_compressed = !is_compressed ? !strcmp("apk", path_get_extension(source_file)) : is_compressed;
|
||||||
|
|
||||||
|
if (!path_file_exists(source_file) || !is_compressed)
|
||||||
{
|
{
|
||||||
RARCH_WARN("[decompress] File '%s' does not exist or is not a compressed file.\n",
|
RARCH_WARN("[decompress] File '%s' does not exist or is not a compressed file.\n",
|
||||||
source_file);
|
source_file);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user