From 440a7f89a2bfeeb8356e15febedddd910bddae79 Mon Sep 17 00:00:00 2001 From: Osvaldo Duran Melendez Date: Thu, 12 Nov 2026 07:33:50 -0500 Subject: [PATCH] Rename: the path length is checked on targets that are neither Unix nor Windows too (browser build) Co-Authored-By: Claude Sonnet 5.5 --- crates/engine/src/rename.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/rename.rs b/crates/engine/src/rename.rs index 31f4f4ac29..e2e93db27d 100644 --- a/crates/engine/src/rename.rs +++ b/crates/engine/src/rename.rs @@ -100,11 +100,16 @@ fn path_len(path: &Path) -> usize { { path.as_os_str().encode_wide().count() } - #[cfg(not(windows))] + #[cfg(unix)] { use std::os::unix::ffi::OsStrExt; path.as_os_str().as_bytes().len() } + // Neither (the browser build): the encoded length, which only its tests see. + #[cfg(not(any(unix, windows)))] + { + path.as_os_str().len() + } } #[cfg(windows)] use std::os::windows::ffi::OsStrExt;