mirror of
https://github.com/rclone/rclone.git
synced 2024-12-23 15:38:57 +01:00
operations: ignore negative sizes when calculating total (#3135)
This commit is contained in:
parent
e2fde62cd9
commit
34f03ce590
@ -960,7 +960,10 @@ func HashLister(ht hash.Type, f fs.Fs, w io.Writer) error {
|
||||
func Count(f fs.Fs) (objects int64, size int64, err error) {
|
||||
err = ListFn(f, func(o fs.Object) {
|
||||
atomic.AddInt64(&objects, 1)
|
||||
atomic.AddInt64(&size, o.Size())
|
||||
objectSize := o.Size()
|
||||
if objectSize > 0 {
|
||||
atomic.AddInt64(&size, objectSize)
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user