We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 01849f8 commit 514260eCopy full SHA for 514260e
Sources/TSCBasic/Path.swift
@@ -258,8 +258,10 @@ public struct RelativePath: Hashable {
258
self.init(PathImpl(string: string))
259
} else {
260
#if _runtime(_ObjC)
261
- let normalized: [Int8] = string.fileSystemRepresentation
262
- self.init(PathImpl(string: String(cString: normalized)))
+ self.init(PathImpl(string: withUnsafeTemporaryAllocation(of: Int8.self, capacity: Int(PATH_MAX) + 1) {
+ string.getFileSystemRepresentation($0.baseAddress, maxLength: $0.count)
263
+ return String(cString: $0.baseAddress!)
264
+ }))
265
#else
266
let normalized: UnsafePointer<Int8> = string.fileSystemRepresentation
267
defer { normalized.deallocate() }
0 commit comments