]> Sergey Matveev's repositories - bfs.git/commitdiff
bftw: Let iterative deepening work depth-first when sorting
authorTavian Barnes <tavianator@tavianator.com>
Thu, 12 Oct 2023 13:44:27 +0000 (09:44 -0400)
committerTavian Barnes <tavianator@tavianator.com>
Thu, 12 Oct 2023 13:44:27 +0000 (09:44 -0400)
src/bftw.c

index 902a3fa770744caccb4c18142c2b52e983e069ba..c58001d8f3d0cc3eb62ab83d51d263ecff5c8623 100644 (file)
@@ -862,7 +862,7 @@ static bool bftw_pop_dir(struct bftw_state *state) {
 
        if (state->flags & BFTW_SORT) {
                // Keep strict breadth-first order when sorting
-               if (state->strategy != BFTW_DFS && have_files) {
+               if (state->strategy == BFTW_BFS && have_files) {
                        return false;
                }
        } else {