From d9faf5a1359487473f9feb5948f7ba138980ff69 Mon Sep 17 00:00:00 2001 From: Wei Zhang Date: Sat, 28 Sep 2024 11:54:49 +0800 Subject: [PATCH] :bug: fix total size loop when using with -a --- src/meta/mod.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/meta/mod.rs b/src/meta/mod.rs index 57ebbe45b..e8384fd19 100644 --- a/src/meta/mod.rs +++ b/src/meta/mod.rs @@ -201,6 +201,11 @@ impl Meta { None => 0, }; for x in &mut metas.iter_mut() { + // must not count the size of '.' and '..', or will be infinite loop + if x.name.name == "." || x.name.name == ".." { + continue; + } + x.calculate_total_size(); size_accumulated += match &x.size { Some(size) => size.get_bytes(),