aboutsummaryrefslogtreecommitdiffstats
path: root/c_ldirs.go
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--c_ldirs.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/c_ldirs.go b/c_ldirs.go
index d7a98a1..77f017d 100644
--- a/c_ldirs.go
+++ b/c_ldirs.go
@@ -155,6 +155,9 @@ func (dir *DirsNode) count_hosts() int {
}
func (ldirs *DirsList) prev(dir *DirsNode) *DirsNode {
+ if ldirs.head == dir {
+ return dir
+ }
for ptr := ldirs.head; ptr != nil; ptr = ptr.next {
if ptr.next == dir {
return ptr