7zip romcmp

This commit is contained in:
Vas Crabb 2016-03-19 00:22:26 +11:00
parent 45f20a43c7
commit b989ad9280

View File

@ -491,11 +491,10 @@ static int load_files(int i, int *found, const char *path)
else else
{ {
util::archive_file::ptr zip; util::archive_file::ptr zip;
util::archive_file::error ziperr;
/* wasn't a directory, so try to open it as a zip file */ /* wasn't a directory, so try to open it as a zip file */
ziperr = util::archive_file::open_zip(path, zip); if ((util::archive_file::open_zip(path, zip) != util::archive_file::error::NONE) &&
if (ziperr != util::archive_file::error::NONE) (util::archive_file::open_7z(path, zip) != util::archive_file::error::NONE))
{ {
printf("Error, cannot open zip file '%s' !\n", path); printf("Error, cannot open zip file '%s' !\n", path);
return 1; return 1;
@ -504,6 +503,8 @@ static int load_files(int i, int *found, const char *path)
/* load all files in zip file */ /* load all files in zip file */
for (int zipent = zip->first_file(); zipent >= 0; zipent = zip->next_file()) for (int zipent = zip->first_file(); zipent >= 0; zipent = zip->next_file())
{ {
if (zip->current_is_directory()) continue;
int size; int size;
size = zip->current_uncompressed_length(); size = zip->current_uncompressed_length();