mirror of
https://github.com/storytold/pdfcraft.git
synced 2026-11-21 11:36:27 +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 <noreply@anthropic.com>
This commit is contained in:
1 parent
894fd5a25a
commit
440a7f89a2
1 file changed
+6
-1
@@ -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