archive-zip: support more than 65535 entries
commit88329ca8091b16f4bb01e3ea546c8c5e1a5016ec
authorRené Scharfe <l.s.r@web.de>
Sat, 22 Aug 2015 19:06:45 +0000 (22 21:06 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Aug 2015 15:54:57 +0000 (28 08:54 -0700)
tree8ae8ac94f5e67ea5a3bdc6517980ec923ed19684
parent0f747f9d37e2b3d7a454029dfcf0065e6914e995
archive-zip: support more than 65535 entries

Support more than 65535 entries cleanly by writing a "zip64 end of
central directory record" (with a 64-bit field for the number of
entries) before the usual "end of central directory record" (which
contains only a 16-bit field).  InfoZIP's zip does the same.
Archives with 65535 or less entries are not affected.

Programs that extract all files like InfoZIP's zip and 7-Zip
ignored the field and could extract all files already.  Software
that relies on the ZIP file directory to show a list of contained
files quickly to simulate to normal directory like Windows'
built-in ZIP functionality only saw a subset of the included files.

Windows supports ZIP64 since Vista according to
https://en.wikipedia.org/wiki/Zip_%28file_format%29#ZIP64.

Suggested-by: Johannes Schauer <josch@debian.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
archive-zip.c
t/t5004-archive-corner-cases.sh