mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
(iOS) Build fix and use zlib_perform_mode in apple/iOS/browser.m
This commit is contained in:
parent
9281595024
commit
ff24ddcd1d
@ -22,7 +22,6 @@
|
|||||||
#include "../../content.h"
|
#include "../../content.h"
|
||||||
#include "../../general.h"
|
#include "../../general.h"
|
||||||
#include <file/dir_list.h>
|
#include <file/dir_list.h>
|
||||||
#include "../../file_ops.h"
|
|
||||||
#include <file/file_path.h>
|
#include <file/file_path.h>
|
||||||
#include <retro_miscellaneous.h>
|
#include <retro_miscellaneous.h>
|
||||||
|
|
||||||
@ -44,23 +43,28 @@ static int zlib_extract_callback(const char *name, const char *valid_exts,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore directories
|
/* Ignore directories */
|
||||||
if (name[strlen(name) - 1] == '/')
|
if (name[strlen(name) - 1] == '/')
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
fill_pathname_join(path, (const char*)userdata, name, sizeof(path));
|
fill_pathname_join(path, (const char*)userdata, name, sizeof(path));
|
||||||
|
|
||||||
switch (cmode)
|
if (!zlib_perform_mode(path, valid_exts,
|
||||||
|
cdata, cmode, csize, size, crc32, userdata))
|
||||||
{
|
{
|
||||||
case 0: // Uncompressed
|
if (cmode == 0)
|
||||||
write_file(path, cdata, size);
|
{
|
||||||
break;
|
RARCH_ERR("Failed to write file: %s.\n", path);
|
||||||
case 8: // Deflate
|
return 0;
|
||||||
zlib_inflate_data_to_file(path, valid_exts, cdata, csize, size, crc32);
|
}
|
||||||
break;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
error:
|
||||||
|
RARCH_ERR("Failed to deflate to: %s.\n", path);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void unzip_file(const char* path, const char* output_directory)
|
static void unzip_file(const char* path, const char* output_directory)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user