aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-php-shim/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-08-09 06:19:30 +0900
committernsfisis <nsfisis@gmail.com>2026-08-09 06:19:30 +0900
commit880a5eaad9dcdfd31563385f11ba1f63d38cfd14 (patch)
tree6f9de7b2b8331628a74287112711f65ae3eddc52 /crates/shirabe-php-shim/src
parentf3d60c7836da0d50d59a22cfd6e4692e3dc75581 (diff)
downloadphp-shirabe-880a5eaad9dcdfd31563385f11ba1f63d38cfd14.tar.gz
php-shirabe-880a5eaad9dcdfd31563385f11ba1f63d38cfd14.tar.zst
php-shirabe-880a5eaad9dcdfd31563385f11ba1f63d38cfd14.zip
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) <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-php-shim/src')
-rw-r--r--crates/shirabe-php-shim/src/fs.rs1
1 files changed, 0 insertions, 1 deletions
diff --git a/crates/shirabe-php-shim/src/fs.rs b/crates/shirabe-php-shim/src/fs.rs
index 00ed6de3..575ce26a 100644
--- a/crates/shirabe-php-shim/src/fs.rs
+++ b/crates/shirabe-php-shim/src/fs.rs
@@ -20,7 +20,6 @@ pub const PATHINFO_DIRNAME: i64 = 1;
pub const PATHINFO_BASENAME: i64 = 2;
pub const PATH_SEPARATOR: &str = ":";
-pub const DIRECTORY_SEPARATOR: &str = "/";
/// PHP `PHP_MAXPATHLEN`: the platform's `MAXPATHLEN` (`MAX_PATH` on Windows).
pub const PHP_MAXPATHLEN: i64 = if cfg!(windows) {