You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2021/02/20 21:23:42 UTC
[commons-compress] branch compress-565-experiment created (now
2b72819)
This is an automated email from the ASF dual-hosted git repository.
bodewig pushed a change to branch compress-565-experiment
in repository https://gitbox.apache.org/repos/asf/commons-compress.git.
at 2b72819 hack for COMPRESS-565 - ignore Zip64Mode.Always for a few CD fields
This branch includes the following new commits:
new 2b72819 hack for COMPRESS-565 - ignore Zip64Mode.Always for a few CD fields
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[commons-compress] 01/01: hack for COMPRESS-565 - ignore
Zip64Mode.Always for a few CD fields
Posted by bo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
bodewig pushed a commit to branch compress-565-experiment
in repository https://gitbox.apache.org/repos/asf/commons-compress.git
commit 2b72819192a4f0d40aed1a45e44054f31c30900b
Author: Stefan Bodewig <bo...@apache.org>
AuthorDate: Sat Feb 20 22:22:49 2021 +0100
hack for COMPRESS-565 - ignore Zip64Mode.Always for a few CD fields
---
.../commons/compress/archivers/zip/ZipArchiveOutputStream.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
index 3f20c29..a7ceb49 100644
--- a/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
+++ b/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
@@ -1435,7 +1435,7 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream {
// disk number start
if(isSplitZip) {
- if (ze.getDiskNumberStart() >= ZIP64_MAGIC_SHORT || zip64Mode == Zip64Mode.Always) {
+ if (ze.getDiskNumberStart() >= ZIP64_MAGIC_SHORT) {
putShort(ZIP64_MAGIC_SHORT, buf, CFH_DISK_NUMBER_OFFSET);
} else {
putShort((int) ze.getDiskNumberStart(), buf, CFH_DISK_NUMBER_OFFSET);
@@ -1451,7 +1451,7 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream {
putLong(ze.getExternalAttributes(), buf, CFH_EXTERNAL_ATTRIBUTES_OFFSET);
// relative offset of LFH
- if (entryMetaData.offset >= ZIP64_MAGIC || zip64Mode == Zip64Mode.Always) {
+ if (entryMetaData.offset >= ZIP64_MAGIC) {
putLong(ZIP64_MAGIC, buf, CFH_LFH_OFFSET);
} else {
putLong(Math.min(entryMetaData.offset, ZIP64_MAGIC), buf, CFH_LFH_OFFSET);
@@ -1488,10 +1488,10 @@ public class ZipArchiveOutputStream extends ArchiveOutputStream {
z64.setCompressedSize(null);
z64.setSize(null);
}
- if (lfhOffset >= ZIP64_MAGIC || zip64Mode == Zip64Mode.Always) {
+ if (lfhOffset >= ZIP64_MAGIC) {
z64.setRelativeHeaderOffset(new ZipEightByteInteger(lfhOffset));
}
- if (ze.getDiskNumberStart() >= ZIP64_MAGIC_SHORT || zip64Mode == Zip64Mode.Always) {
+ if (ze.getDiskNumberStart() >= ZIP64_MAGIC_SHORT) {
z64.setDiskStartNumber(new ZipLong(ze.getDiskNumberStart()));
}
ze.setExtra();