aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/minizip/miniunz.c17
-rw-r--r--contrib/minizip/minizip.c2
2 files changed, 10 insertions, 9 deletions
diff --git a/contrib/minizip/miniunz.c b/contrib/minizip/miniunz.c
index fd09ff08..c1806728 100644
--- a/contrib/minizip/miniunz.c
+++ b/contrib/minizip/miniunz.c
@@ -482,13 +482,17 @@ static int do_extract(unzFile uf, int opt_extract_without_path, int opt_overwrit
482 482
483 err = unzGetGlobalInfo64(uf,&gi); 483 err = unzGetGlobalInfo64(uf,&gi);
484 if (err!=UNZ_OK) 484 if (err!=UNZ_OK)
485 {
485 printf("error %d with zipfile in unzGetGlobalInfo\n",err); 486 printf("error %d with zipfile in unzGetGlobalInfo\n",err);
487 return err;
488 }
486 489
487 for (i=0;i<gi.number_entry;i++) 490 for (i=0;i<gi.number_entry;i++)
488 { 491 {
489 if (do_extract_currentfile(uf,&opt_extract_without_path, 492 err = do_extract_currentfile(uf,&opt_extract_without_path,
490 &opt_overwrite, 493 &opt_overwrite,
491 password) != UNZ_OK) 494 password);
495 if (err != UNZ_OK)
492 break; 496 break;
493 497
494 if ((i+1)<gi.number_entry) 498 if ((i+1)<gi.number_entry)
@@ -502,7 +506,7 @@ static int do_extract(unzFile uf, int opt_extract_without_path, int opt_overwrit
502 } 506 }
503 } 507 }
504 508
505 return 0; 509 return err;
506} 510}
507 511
508static int do_extract_onefile(unzFile uf, const char* filename, int opt_extract_without_path, int opt_overwrite, const char* password) { 512static int do_extract_onefile(unzFile uf, const char* filename, int opt_extract_without_path, int opt_overwrite, const char* password) {
@@ -512,12 +516,9 @@ static int do_extract_onefile(unzFile uf, const char* filename, int opt_extract_
512 return 2; 516 return 2;
513 } 517 }
514 518
515 if (do_extract_currentfile(uf,&opt_extract_without_path, 519 return do_extract_currentfile(uf,&opt_extract_without_path,
516 &opt_overwrite, 520 &opt_overwrite,
517 password) == UNZ_OK) 521 password);
518 return 0;
519 else
520 return 1;
521} 522}
522 523
523 524
diff --git a/contrib/minizip/minizip.c b/contrib/minizip/minizip.c
index 7429ce5a..46a6d798 100644
--- a/contrib/minizip/minizip.c
+++ b/contrib/minizip/minizip.c
@@ -508,5 +508,5 @@ int main(int argc, char *argv[]) {
508 } 508 }
509 509
510 free(buf); 510 free(buf);
511 return 0; 511 return err;
512} 512}