Skip to content

Commit 86f5896

Browse files
committed
Fix currentWorkingDirectory
String.init(cString:) may change the content
1 parent 201f43b commit 86f5896

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Subprocess/Configuration.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ extension FilePath {
888888
static var currentWorkingDirectory: Self {
889889
let path = getcwd(nil, 0)!
890890
defer { free(path) }
891-
return .init(String(cString: path))
891+
return .init(platformString: path)
892892
}
893893
}
894894

0 commit comments

Comments
 (0)