4
0
mirror of https://github.com/QuasarApp/zip.git synced 2025-05-11 19:29:34 +00:00

Allow opening read-only ZIP files ()

This commit is contained in:
Thomas Perl 2022-09-16 21:45:45 +02:00 committed by GitHub
parent 114d9d46fd
commit 7a57414261
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -842,6 +842,15 @@ struct zip_t *zip_open(const char *zipname, int level, char mode) {
break;
case 'r':
if (!mz_zip_reader_init_file_v2(
&(zip->archive), zipname,
zip->level | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY, 0, 0)) {
// An archive file does not exist or cannot initialize
// zip_archive reader
goto cleanup;
}
break;
case 'a':
case 'd':
if (!mz_zip_reader_init_file_v2_rpb(