fix: the issue where preview fails when the path length exceeds 255 characters (#280)

This commit is contained in:
shiro.lee
2025-07-22 22:10:57 +08:00
committed by GitHub
parent aa1a3ce4e8
commit 629db6218e

View File

@@ -49,7 +49,8 @@ pub fn check_path_length(path_name: &str) -> Result<()> {
let mut count = 0usize;
for c in path_name.chars() {
match c {
'/' | '\\' if cfg!(target_os = "windows") => count = 0, // Reset
'/' => count = 0,
'\\' if cfg!(target_os = "windows") => count = 0, // Reset
_ => {
count += 1;
if count > 255 {