summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2019-05-29 19:05:50 -0400
committerTavian Barnes <tavianator@tavianator.com>2019-05-29 19:05:50 -0400
commitecb0f5651b779c38ef25787cd26fc9a83687badc (patch)
treee8773e22ac104da8f0e0aacdff263ba78552a3b9 /eval.c
parentfda29616c7af6b6e2a79c596cc01123a2d68ee02 (diff)
downloadbfs-ecb0f5651b779c38ef25787cd26fc9a83687badc.tar.xz
Implement an iterative deepening mode (-ids)
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 6d13970..c075343 100644
--- a/eval.c
+++ b/eval.c
@@ -1228,7 +1228,7 @@ static enum bftw_action cmdline_callback(const struct BFTW *ftwbuf, void *ptr) {
// In -depth mode, only handle directories on the BFTW_POST visit
enum bftw_visit expected_visit = BFTW_PRE;
if ((cmdline->flags & BFTW_DEPTH)
- && ftwbuf->typeflag == BFTW_DIR
+ && (cmdline->strategy == BFTW_IDS || ftwbuf->typeflag == BFTW_DIR)
&& ftwbuf->depth < cmdline->maxdepth) {
expected_visit = BFTW_POST;
}
@@ -1332,6 +1332,7 @@ static const char *dump_bftw_strategy(enum bftw_strategy strategy) {
static const char *strategies[] = {
DUMP_BFTW_MAP(BFTW_BFS),
DUMP_BFTW_MAP(BFTW_DFS),
+ DUMP_BFTW_MAP(BFTW_IDS),
};
return strategies[strategy];
}