Fix edge case infinite loop with Get

main v0.20.4
Rob Muhlestein 1 year ago
parent 4419500e80
commit 3b302d0394
No known key found for this signature in database
GPG Key ID: 7542BA4ED72E5D81

@ -540,8 +540,14 @@ func (x *Cmd) PathCmds() []*Cmd {
func (x *Cmd) PathNames() []string {
path := qstack.New[string]()
path.Unshift(x.Name)
for p := x.Caller; p != nil; p = p.Caller {
log.Print(x.Caller)
p := x.Caller
for p != nil {
path.Unshift(p.Name)
if p == p.Caller {
break
}
p = p.Caller
}
path.Shift()
return path.Items()

Loading…
Cancel
Save