From 880a5eaad9dcdfd31563385f11ba1f63d38cfd14 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 9 Aug 2026 06:19:30 +0900 Subject: refactor(php-shim): use std::path::MAIN_SEPARATOR over a shim constant The shim's DIRECTORY_SEPARATOR was hardcoded to "/", so every ported `'\\' === DIRECTORY_SEPARATOR` check compared against a constant that does not track the target platform. std::path::MAIN_SEPARATOR and MAIN_SEPARATOR_STR carry the same meaning as PHP's constant and resolve per platform, so the Windows branches are selected on Windows targets. Co-Authored-By: Claude Opus 5 (1M context) --- .../src/symfony/console/output/stream_output.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'crates/shirabe-external-packages/src/symfony/console/output') diff --git a/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs b/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs index 9140dbc8..8ee2f186 100644 --- a/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs +++ b/crates/shirabe-external-packages/src/symfony/console/output/stream_output.rs @@ -98,8 +98,7 @@ impl StreamOutput { return false; } - if "\\" == shirabe_php_shim::DIRECTORY_SEPARATOR - && shirabe_php_shim::sapi_windows_vt100_support(stream) + if std::path::MAIN_SEPARATOR == '\\' && shirabe_php_shim::sapi_windows_vt100_support(stream) { return true; } -- cgit v1.3.1-4-g156e