Commit cb4bbc95 authored by Drew's avatar Drew

Update to Swift Preview 5

parent 361b47bd
Subproject commit 6fdd57f7daa08b9ab19fced0392aeeb3edc87d9d
Subproject commit b8f458526644c02ad39e46099def2ad5b53514af
......@@ -110,10 +110,13 @@ func waitpid(_ pid: pid_t) -> Int32 {
///Rather than calls that aren't
func anarchySystem(_ cmd: String, environment: [String: String]) {
var pid : pid_t = 0
//copy PATH
let path = getenv("PATH")!
//copy a few well-known values
var environment = environment
environment["PATH"] = String(validatingUTF8: path)!
for arg in ["PATH","HOME"] {
if let path = getenv(arg) {
environment[arg] = String(validatingUTF8: path)!
}
}
let args: [String] = ["sh","-c",cmd]
let argv = args.map{ $0.withCString(strdup) }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment