summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-10-10 07:42:13 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-10-10 07:42:13 +0200
commit7f57d5d9c58d9a471181f3f91e3c037b49cede9f (patch)
tree89fe41c0a2d31d35807c697090f1d3880d2b869e
parent3b99a601546a722838cfdb65de9848b7a367b169 (diff)
unzip/zipfs: handle optional data descriptor signature in trailer
-rw-r--r--sys/src/cmd/gzip/unzip.c2
-rw-r--r--sys/src/cmd/tapefs/zipfs.c2
2 files changed, 4 insertions, 0 deletions
diff --git a/sys/src/cmd/gzip/unzip.c b/sys/src/cmd/gzip/unzip.c
index 488a33065..cf197f6d6 100644
--- a/sys/src/cmd/gzip/unzip.c
+++ b/sys/src/cmd/gzip/unzip.c
@@ -657,6 +657,8 @@ trailer(Biobuf *bin, ZipHead *zh)
{
if(zh->flags & ZTrailInfo){
zh->crc = get4(bin);
+ if(zh->crc == 0x08074b50) /* thanks apple */
+ zh->crc = get4(bin);
zh->csize = get4(bin);
zh->uncsize = get4(bin);
}
diff --git a/sys/src/cmd/tapefs/zipfs.c b/sys/src/cmd/tapefs/zipfs.c
index a7279b2e0..40d022e96 100644
--- a/sys/src/cmd/tapefs/zipfs.c
+++ b/sys/src/cmd/tapefs/zipfs.c
@@ -304,6 +304,8 @@ trailer(Biobuf *bin, ZipHead *zh)
{
if(zh->flags & ZTrailInfo){
zh->crc = get4(bin);
+ if(zh->crc == 0x08074b50) /* thanks apple */
+ zh->crc = get4(bin);
zh->csize = get4(bin);
zh->uncsize = get4(bin);
}