infra: fix default tree recursion depth

This commit is contained in:
Thomas Schoebel-Theuer 2020-07-15 22:13:40 +02:00 committed by Thomas Schoebel-Theuer
parent 9c63bf0a38
commit a751ec7c42
1 changed files with 2 additions and 1 deletions

View File

@ -1784,7 +1784,8 @@ int _op_scan(struct say_channel **say_channel,
* a new subtree.
*/
if (S_ISDIR(dent->new_stat.mode) &&
dent->d_depth <= maxdepth &&
(maxdepth <= 0 ||
dent->d_depth <= maxdepth) &&
(!has_dir_list ||
dent->d_depth > 0 ||
dir_path_is_in(dent->d_path, path_list))) {