Skip to content

Commit 83bd0d5

Browse files
committed
Use _CFEnviron() instead of environ as it is more portable.
1 parent 40bc8a5 commit 83bd0d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Foundation/ProcessInfo.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ open class ProcessInfo: NSObject {
4545
let equalSign = Int32(UInt8(ascii: "="))
4646
var env: [String : String] = [:]
4747
var idx = 0
48-
let envp = environ
48+
let envp = _CFEnviron()
4949

5050
while let entry = envp.advanced(by: idx).pointee {
5151
if let value = strchr(entry, equalSign) {

0 commit comments

Comments
 (0)