1
Fork 0

Fix Windows Command search path bug

This commit is contained in:
Chris Denton 2025-02-26 13:18:44 +00:00
parent c51b9b6d52
commit 4fcebee60a
No known key found for this signature in database
GPG key ID: 713472F2F45627DE
2 changed files with 74 additions and 1 deletions

View file

@ -260,9 +260,10 @@ impl Command {
needs_stdin: bool,
proc_thread_attribute_list: Option<&ProcThreadAttributeList<'_>>,
) -> io::Result<(Process, StdioPipes)> {
let env_saw_path = self.env.have_changed_path();
let maybe_env = self.env.capture_if_changed();
let child_paths = if let Some(env) = maybe_env.as_ref() {
let child_paths = if env_saw_path && let Some(env) = maybe_env.as_ref() {
env.get(&EnvKey::new("PATH")).map(|s| s.as_os_str())
} else {
None