mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-12-01 22:18:31 +00:00
Rename: the path length is checked on targets that are neither Unix nor Windows too (browser build)
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
894fd5a25a
commit
440a7f89a2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user