1
0
mirror of https://github.com/rclone/rclone.git synced 2026-01-07 02:54:04 +00:00

sync: fix cpu spinning when empty directory finding with leading slashes

Before this change the logic which makes sure we create all
directories could get confused with directories which started with
slashes and get into an infinite loop consuming 100% of the CPU.
This commit is contained in:
Nick Craig-Wood
2025-01-11 12:49:40 +00:00
parent ff4d7c8dd0
commit 6eb8919719

View File

@@ -726,7 +726,7 @@ func (s *syncCopyMove) markParentNotEmpty(entry fs.DirEntry) {
parentDir = ""
}
delete(s.srcEmptyDirs, parentDir)
if parentDir == "" {
if parentDir == "" || parentDir == "/" {
break
}
parentDir = path.Dir(parentDir)