mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-28 07:57:01 +00:00
fix: the issue where preview fails when the path length exceeds 255 characters (#280)
This commit is contained in:
@@ -49,7 +49,8 @@ pub fn check_path_length(path_name: &str) -> Result<()> {
|
|||||||
let mut count = 0usize;
|
let mut count = 0usize;
|
||||||
for c in path_name.chars() {
|
for c in path_name.chars() {
|
||||||
match c {
|
match c {
|
||||||
'/' | '\\' if cfg!(target_os = "windows") => count = 0, // Reset
|
'/' => count = 0,
|
||||||
|
'\\' if cfg!(target_os = "windows") => count = 0, // Reset
|
||||||
_ => {
|
_ => {
|
||||||
count += 1;
|
count += 1;
|
||||||
if count > 255 {
|
if count > 255 {
|
||||||
|
|||||||
Reference in New Issue
Block a user