From 0e0ff5f3a5a534d1060b10f5ca2a21d56f439a68 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sat, 12 Oct 2013 19:37:13 +0200 Subject: ignore the root of the crawl for -v MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/bfind.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bfind.py b/src/bfind.py index 081a8d0..c757875 100755 --- a/src/bfind.py +++ b/src/bfind.py @@ -43,6 +43,7 @@ visited_name = set() visited_id = set() queue = None start_dev = os.stat(path if path != '' else '.').st_dev +start_len = len(path) if path == '': queue = os.listdir() @@ -52,7 +53,7 @@ else: while len(queue) > 0: path = queue[0] queue[:] = queue[1:] - if visible and (path.startswith('.') or ((os.sep + '.') in path)): + if visible and ((os.sep + '.') in path[start_len:]): continue if hardlinks: stat = os.stat(path) -- cgit v1.2.3-70-g09d2