Skip to content

Commit

Permalink
New sophisticated debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
fpseverino committed Sep 9, 2024
1 parent 48a3582 commit 56b206f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions Sources/Zip/Zip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ public class Zip {

var isDirectory = false
let fileInfoSizeFileName = Int(fileInfo.size_filename - 1)
print("fileName[fileInfoSizeFileName] = \(fileName[fileInfoSizeFileName])")
if (fileName[fileInfoSizeFileName] == "/".cString(using: String.Encoding.utf8)?.first || fileName[fileInfoSizeFileName] == "\\".cString(using: String.Encoding.utf8)?.first) {
isDirectory = true
}
Expand Down Expand Up @@ -144,14 +145,7 @@ public class Zip {
}

var writeBytes: UInt64 = 0
#if os(Windows)
let filePointer: UnsafeMutablePointer<FILE>? = fopen(
fullPath.prefix(2) + fullPath.dropFirst(2).replacingOccurrences(of: ":", with: "/"),
"wb"
)
#else
let filePointer: UnsafeMutablePointer<FILE>? = fopen(fullPath, "wb")
#endif
while let filePointer {
let readBytes = unzReadCurrentFile(zip, &buffer, bufferSize)
guard readBytes > 0 else { break }
Expand Down

0 comments on commit 56b206f

Please sign in to comment.