From 6b83e68d7961f150ec15dd59d457d519e0bf8663 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 9 Aug 2026 06:50:56 +0900 Subject: refactor(env): split and join PATH lists with std::env The shim's PATH_SEPARATOR was hardcoded to ":", so every PATH list was split and joined on the wrong character off Unix. std::env::split_paths and join_paths use the platform's separator, which also lets the bin-dir membership test in EventDispatcher compare list entries instead of regex-matching the raw PATH string. Co-Authored-By: Claude Opus 5 (1M context) --- .../src/symfony/process/executable_finder.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/process/executable_finder.rs') diff --git a/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs b/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs index 309cdf7e..5b1c0994 100644 --- a/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs +++ b/crates/shirabe-external-packages/src/symfony/process/executable_finder.rs @@ -33,7 +33,9 @@ impl ExecutableFinder { .or_else(|| shirabe_php_shim::getenv("Path")) .map(|v| v.to_string_lossy().into_owned()) .unwrap_or_default(); - let mut dirs = shirabe_php_shim::explode(shirabe_php_shim::PATH_SEPARATOR, &path); + let mut dirs: Vec = std::env::split_paths(&path) + .map(|dir| dir.into_os_string().into_string().unwrap()) + .collect(); dirs.extend_from_slice(extra_dirs); let mut suffixes: Vec = vec![]; @@ -42,9 +44,9 @@ impl ExecutableFinder { shirabe_php_shim::getenv("PATHEXT").map(|v| v.to_string_lossy().into_owned()); suffixes = self.suffixes.clone(); let exts = match path_ext { - Some(ref ext) if !ext.is_empty() => { - shirabe_php_shim::explode(shirabe_php_shim::PATH_SEPARATOR, ext) - } + Some(ref ext) if !ext.is_empty() => std::env::split_paths(ext) + .map(|e| e.into_os_string().into_string().unwrap()) + .collect(), _ => vec![ ".exe".to_string(), ".bat".to_string(), -- cgit v1.3.1-4-g156e