make -H option work right

This commit is contained in:
Lilian Jónsdóttir 2024-07-15 16:20:46 -07:00
parent 689500c942
commit dfed84eb74

View file

@ -89,9 +89,9 @@ func FindDisk(dir string, recursive bool, f *filter.Filter) (files Files, err er
return return
} }
// is_in_recursive_dir checks `path` and parent directories // is_in_hidden_dir checks `path` and parent directories
// of `path` up to `base` for a hidden parent // of `path` up to `base` for a hidden parent
func is_in_recursive_dir(base, path string) bool { func is_in_hidden_dir(base, path string) bool {
me := path me := path
for { for {
me = filepath.Clean(me) me = filepath.Clean(me)
@ -112,7 +112,7 @@ func walk_dir(dir string, f *filter.Filter) (files Files) {
return nil return nil
} }
if is_in_recursive_dir(dir, path) && !f.IgnoreHidden() { if is_in_hidden_dir(dir, path) && f.IgnoreHidden() {
return nil return nil
} }