From 8acbdf8f2318728831f7006651c2484eff9e367f Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 8 Jan 2024 20:20:20 +0100 Subject: cool --- c_ldirs.go | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'c_ldirs.go') diff --git a/c_ldirs.go b/c_ldirs.go index af24c28..ee8977b 100644 --- a/c_ldirs.go +++ b/c_ldirs.go @@ -96,16 +96,23 @@ func (ldirs *DirsList) sel(id int) *DirsNode { } // returns a string with the full path of the dir -func (ldirs *DirsList) path(node *DirsNode) string { +func (dir *DirsNode) path() string { var path string - if node == nil { + if dir == nil { return "" } - curr := node + curr := dir for curr != nil { path = curr.Name + "/" + path curr = curr.Parent } return path } + +func (dir *DirsNode) count_hosts() int { + if dir.lhost.head == nil { + return 0 + } + return dir.lhost.last.ID + 1 +} -- cgit v1.2.3