Merge branch 'hotfix-2.4.3' into develop

This commit is contained in:
Timofey Solomko
2017-05-25 10:43:52 +03:00
2 changed files with 6 additions and 3 deletions
+4
View File
@@ -20,6 +20,10 @@ v3.0.0
- In CocoaPods configurations availability of such support depends on
the presence of corresponding podspecs.
v2.4.3
----------------
- Fixed incorrect calculation of header's checksum for GZip archives.
v2.4.2
----------------
- Fixed a problem, where ZipEntry.fileName was returning fileComment instead.
+2 -3
View File
@@ -95,7 +95,6 @@ public struct GzipHeader {
- Throws: `GzipError`. It may indicate that either the data is damaged or
it might not be compressed with gzip at all.
*/
public init(archiveData: Data) throws {
let pointerData = DataWithPointer(data: archiveData, bitOrder: .reversed)
try self.init(pointerData)
@@ -148,9 +147,9 @@ public struct GzipHeader {
var fnameBytes: [UInt8] = []
while true {
let byte = pointerData.alignedByte()
headerBytes.append(byte)
guard byte != 0 else { break }
fnameBytes.append(byte)
headerBytes.append(byte)
}
self.originalFileName = String(data: Data(fnameBytes), encoding: .utf8)
} else {
@@ -162,9 +161,9 @@ public struct GzipHeader {
var fcommentBytes: [UInt8] = []
while true {
let byte = pointerData.alignedByte()
headerBytes.append(byte)
guard byte != 0 else { break }
fcommentBytes.append(byte)
headerBytes.append(byte)
}
self.comment = String(data: Data(fcommentBytes), encoding: .utf8)
} else {