Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions library/std/src/sys/unix/process/process_common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,11 +253,17 @@ impl Command {
let maybe_env = self.env.capture_if_changed();
maybe_env.map(|env| construct_envp(env, &mut self.saw_nul))
}

#[allow(dead_code)]
pub fn env_saw_path(&self) -> bool {
self.env.have_changed_path()
}

#[allow(dead_code)]
pub fn program_is_path(&self) -> bool {
self.program.to_bytes().contains(&b'/')
}

pub fn setup_io(
&self,
default: Stdio,
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/sys/unix/process/process_unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ impl Command {

if self.get_gid().is_some()
|| self.get_uid().is_some()
|| self.env_saw_path()
|| (self.env_saw_path() && !self.program_is_path())
|| !self.get_closures().is_empty()
{
return Ok(None);
Expand Down