Skip to content

Commit

Permalink
Merge pull request #1359 from bgilbert/path
Browse files Browse the repository at this point in the history
exec/util: fix infinite loop in `Depth()` if `-root` is relative
  • Loading branch information
bgilbert authored May 10, 2022
2 parents 8c03e60 + e62e972 commit b0def86
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/exec/util/path_sort.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

func Depth(path string) uint {
var count uint = 0
for p := filepath.Clean(path); p != "/"; count++ {
for p := filepath.Clean(path); p != "/" && p != "."; count++ {
p = filepath.Dir(p)
}
return count
Expand Down

0 comments on commit b0def86

Please sign in to comment.