fix(platform): normalize native paths for storage and backup validation

This commit is contained in:
eezd committed 2026-10-27 15:03:57 +08:00
1 parent bea53ce3c8
commit 1a8f70ca13
9 files changed
+120 -8

No files matched your search

+3 -1
View File
@@ -21,7 +21,9 @@ func IsLocalPath(name string) bool {
}
}
for _, part := range strings.Split(name, "/") {
if strings.HasSuffix(part, " ") || strings.HasSuffix(part, ".") {
// Reject device basenames on every supported Windows version, including extensions.
base, _, _ := strings.Cut(part, ".")
if (base != "" && !filepath.IsLocal(strings.TrimRight(base, " "))) || strings.HasSuffix(part, " ") || strings.HasSuffix(part, ".") {
return false
}
}