mirror of
https://github.com/tsolomko/SWCompression.git
synced 2026-06-23 14:56:41 +00:00
Fixed a mistake with length of fileComment.
This commit is contained in:
@@ -58,7 +58,7 @@ public class ZipEntry: ContainerEntry {
|
||||
private var pointerData: DataWithPointer
|
||||
|
||||
/// Name of the file or directory.
|
||||
public var name: String? {
|
||||
public var name: String {
|
||||
return self.cdEntry.fileName
|
||||
}
|
||||
|
||||
@@ -72,6 +72,14 @@ public class ZipEntry: ContainerEntry {
|
||||
return self.cdEntry.externalFileAttributes
|
||||
}
|
||||
|
||||
public var size: Int {
|
||||
return Int(truncatingBitPattern: cdEntry.uncompSize)
|
||||
}
|
||||
|
||||
public var isDirectory: Bool {
|
||||
return false // TODO: Implement.
|
||||
}
|
||||
|
||||
/**
|
||||
Returns data associated with this entry.
|
||||
|
||||
@@ -396,7 +404,7 @@ struct CentralDirectoryEntry {
|
||||
}
|
||||
}
|
||||
|
||||
guard let fileComment = String(data: Data(bytes: pointerData.alignedBytes(count: fileNameLength)),
|
||||
guard let fileComment = String(data: Data(bytes: pointerData.alignedBytes(count: fileCommentLength)),
|
||||
encoding: .utf8)
|
||||
else { throw ZipError.wrongTextField }
|
||||
self.fileComment = fileComment
|
||||
|
||||
Reference in New Issue
Block a user