You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No error when trying to extract a single file that is not in archive #364
As we can seen in the sources, in the case of trying to extract a single file that is not in an archive, mz_zip_reader_save_all is supposed to return MZ_END_OF_LIST error:
int32_t minizip_extract(const char *path, const char *patter
8000
n, const char *destination, const char *password, minizip_opt *options)
{
[...]
/* Save all entries in zip file to destination directory */
err = mz_zip_reader_save_all(reader, destination);
if (err == MZ_END_OF_LIST && pattern != NULL)
printf("Files matching %s not found in zip file\n", pattern);
[...]
}
For example with file ZipExample.zip containing a few files:
If I extract an existing file it actually return MZ_OK (0) but it also returns MZ_OK when trying to extract a non-existing file (and we can see that the "file matching not found" log is not printed):
I'm using your lib in a C++ project then I got a easy workaround calling boost::filesystem::is_regular_file(destinationFolder / singleFile) after extract of single file but it would be nice to have mz_zip_reader_save_all actually returning proper error in this case.
Activity
Fixed no error when trying to extract a single file that is not in ar…
nmoinvaz commentedon Feb 13, 2019
I have just made a commit in the
devbranch that should fix your issue. Let me know, thanks.gluttony38 commentedon Feb 20, 2019
Works for me, thanks !