Skip to content

Commit 7d3fb99

Browse files
mai93copybara-github
authored andcommitted
Support ZIP files with total number of disks = 0
We came across [a problem](https://buildkite.com/bazel/intellij-plugin/builds/15968#0863eaa6-499b-46a2-a146-79d4c2b830c0) adding a jar provided by IntelliJ in its 2022.1 (lib/app.jar) to a `java_import` target because the jar in this version has a total number of disks = 0. This value is supported by other tools: https://github.com/python/cpython/blob/main/Lib/zipfile.py#L258 PiperOrigin-RevId: 440322029
1 parent 32e841d commit 7d3fb99

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

third_party/ijar/zip.cc

+2-1
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,8 @@ bool FindZip64CentralDirectory(const u1 *bytes, size_t in_length,
707707
if (MaybeReadZip64CentralDirectory(bytes, in_length,
708708
bytes + zip64_end_of_central_dir_offset,
709709
end_of_central_dir, cd)) {
710-
if (disk_with_zip64_central_directory != 0 || zip64_total_disks != 1) {
710+
// TODO(b/228519294) Add a test for a valid zip64 file with total disks = 0
711+
if (disk_with_zip64_central_directory != 0 || zip64_total_disks > 1) {
711712
fprintf(stderr, "multi-disk JAR files are not supported\n");
712713
return false;
713714
}

0 commit comments

Comments
 (0)