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) --- crates/shirabe/tests/util/ini_helper_test.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'crates/shirabe/tests') diff --git a/crates/shirabe/tests/util/ini_helper_test.rs b/crates/shirabe/tests/util/ini_helper_test.rs index 0b3835a0..90015169 100644 --- a/crates/shirabe/tests/util/ini_helper_test.rs +++ b/crates/shirabe/tests/util/ini_helper_test.rs @@ -2,7 +2,7 @@ use shirabe::util::ini_helper::IniHelper; use shirabe::util::platform::Platform; -use shirabe_php_shim::{PATH_SEPARATOR, getenv, putenv}; +use shirabe_php_shim::{getenv, putenv}; #[allow(dead_code)] fn set_up() -> TearDown { @@ -39,7 +39,12 @@ impl Drop for TearDown { } fn set_env(paths: &[&str]) { - unsafe { putenv("COMPOSER_ORIGINAL_INIS", paths.join(PATH_SEPARATOR)) }; + unsafe { + putenv( + "COMPOSER_ORIGINAL_INIS", + std::env::join_paths(paths).unwrap(), + ) + }; } #[test] -- cgit v1.3.1-4-g156e