Skip to content

Commit cc9e394

Browse files
authored
Merge pull request #2667 from compnerd/follow-the-process
Foundation: clear up string abuse on Windows
2 parents 6d5d04e + e84a970 commit cc9e394

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Foundation/Process.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ open class Process: NSObject {
632632

633633
let workingDirectory = currentDirectoryURL?.path ?? FileManager.default.currentDirectoryPath
634634
try quoteWindowsCommandLine(command).withCString(encodedAs: UTF16.self) { wszCommandLine in
635-
try workingDirectory.withCString(encodedAs: UTF16.self) { wszCurrentDirectory in
635+
try FileManager.default._fileSystemRepresentation(withPath: workingDirectory) { wszCurrentDirectory in
636636
try szEnvironment.withCString(encodedAs: UTF16.self) { wszEnvironment in
637637
if !CreateProcessW(nil, UnsafeMutablePointer<WCHAR>(mutating: wszCommandLine),
638638
nil, nil, true,

0 commit comments

Comments
 (0)