aboutsummaryrefslogtreecommitdiffstats
path: root/c_ldirs.go
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-01-10 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-01-10 20:20:20 +0100
commit9e3247465a6a246f4de17b0337ef1578e1c6e2be (patch)
tree50de717d746270288a23193769d17efde492b38a /c_ldirs.go
parentgood (diff)
downloadhardflip-9e3247465a6a246f4de17b0337ef1578e1c6e2be.tar.gz
hardflip-9e3247465a6a246f4de17b0337ef1578e1c6e2be.tar.bz2
hardflip-9e3247465a6a246f4de17b0337ef1578e1c6e2be.tar.xz
hardflip-9e3247465a6a246f4de17b0337ef1578e1c6e2be.tar.zst
hardflip-9e3247465a6a246f4de17b0337ef1578e1c6e2be.zip
sick
Diffstat (limited to '')
-rw-r--r--c_ldirs.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/c_ldirs.go b/c_ldirs.go
index 96381fd..906e368 100644
--- a/c_ldirs.go
+++ b/c_ldirs.go
@@ -120,12 +120,16 @@ func (dir *DirsNode) count_hosts() int {
}
// return the number of hosts and subfolders of the dir
-func (dir *DirsNode) count_elements() int {
+func (dir *DirsNode) count_elements(skip_folds bool) int {
items := 0
items += dir.count_hosts()
for ptr := dir.next; ptr != nil && ptr.Depth > dir.Depth; ptr = ptr.next {
- items += ptr.count_hosts() + 1
+ if skip_folds == true && ptr.Folded == true {
+ items += 1
+ } else {
+ items += ptr.count_hosts() + 1
+ }
}
return items
}