diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-05-29 19:05:50 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-05-29 19:05:50 -0400 |
commit | ecb0f5651b779c38ef25787cd26fc9a83687badc (patch) | |
tree | e8773e22ac104da8f0e0aacdff263ba78552a3b9 /eval.c | |
parent | fda29616c7af6b6e2a79c596cc01123a2d68ee02 (diff) | |
download | bfs-ecb0f5651b779c38ef25787cd26fc9a83687badc.tar.xz |
Implement an iterative deepening mode (-ids)
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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]; } |