1
mirror of https://github.com/rclone/rclone synced 2025-02-18 14:11:27 +01: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 77429b154e
commit c837664653

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)