From bb63a4c6d7029aea5180f8c09ac256c39328102e Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sun, 14 May 2017 22:32:50 +0200 Subject: [PATCH] Fix search with hidden root path --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5c8a35e..fed3f3b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -106,7 +106,9 @@ fn scan(root: &Path, pattern: &Regex, config: &FdOptions) { .follow_links(config.follow_links) .max_depth(config.max_depth) .into_iter() - .filter_entry(|e| config.search_hidden || !is_hidden(e)) + .filter_entry(|e| config.search_hidden + || !is_hidden(e) + || e.path() == root) .filter_map(|e| e.ok()) .filter(|e| e.path() != root);