diff options
author | Joe <rbo@gmx.us> | 2024-01-08 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-08 20:20:20 +0100 |
commit | 8acbdf8f2318728831f7006651c2484eff9e367f (patch) | |
tree | 199ed6f16be4313c983108c3ea7614e299ebabb6 /c_ldirs.go | |
parent | factor (diff) | |
download | hardflip-8acbdf8f2318728831f7006651c2484eff9e367f.tar.gz hardflip-8acbdf8f2318728831f7006651c2484eff9e367f.tar.bz2 hardflip-8acbdf8f2318728831f7006651c2484eff9e367f.tar.xz hardflip-8acbdf8f2318728831f7006651c2484eff9e367f.tar.zst hardflip-8acbdf8f2318728831f7006651c2484eff9e367f.zip |
cool
Diffstat (limited to 'c_ldirs.go')
-rw-r--r-- | c_ldirs.go | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -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 +} |