Don't remove the file for newly created, changed archives without survivors. --HG-- branch : HEAD
diff --git a/lib/zip_close.c b/lib/zip_close.c index 49462d8..f5dc3a6 100644 --- a/lib/zip_close.c +++ b/lib/zip_close.c
@@ -91,7 +91,7 @@ /* don't create zip files with no entries */ if (survivors == 0) { - if (za->zn) { + if (za->zn && za->zp) { if (remove(za->zn) != 0) { _zip_error_set(&za->error, ZIP_ER_REMOVE, errno); return -1;