mirror of
https://github.com/QuasarApp/zip.git
synced 2025-05-11 19:29:34 +00:00
Allow opening read-only ZIP files (#278)
This commit is contained in:
parent
114d9d46fd
commit
7a57414261
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user