Skip to content
Snippets Groups Projects
Commit ae89b127 authored by stratact's avatar stratact
Browse files

Take 3 for Redox

parent 924a4b77
No related branches found
No related tags found
No related merge requests found
...@@ -160,12 +160,12 @@ pub fn execve<S: AsRef<str>>(prog: &str, args: &[S], clear_env: bool) -> io::Err ...@@ -160,12 +160,12 @@ pub fn execve<S: AsRef<str>>(prog: &str, args: &[S], clear_env: bool) -> io::Err
// This is a fully specified scheme or path to an // This is a fully specified scheme or path to an
// executable. // executable.
Some(PathBuf::from(prog)) Some(PathBuf::from(prog))
} else if let Ok(paths) = env::var("PATH") { } else if let Ok(paths) = var("PATH") {
// This is not a fully specified scheme or path. // This is not a fully specified scheme or path.
// Iterate through the possible paths in the // Iterate through the possible paths in the
// env var PATH that this executable may be found // env var PATH that this executable may be found
// in and return the first one found. // in and return the first one found.
env::split_paths(&paths) split_paths(&paths)
.filter_map(|mut path| { .filter_map(|mut path| {
path.push(prog); path.push(prog);
if path.exists() { if path.exists() {
...@@ -181,8 +181,8 @@ pub fn execve<S: AsRef<str>>(prog: &str, args: &[S], clear_env: bool) -> io::Err ...@@ -181,8 +181,8 @@ pub fn execve<S: AsRef<str>>(prog: &str, args: &[S], clear_env: bool) -> io::Err
// If clear_env set, clear the env. // If clear_env set, clear the env.
if clear_env { if clear_env {
for (key, _) in env::vars() { for (key, _) in vars() {
env::remove_var(key); remove_var(key);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment