Fix for #3 and maximum scan depth

This commit is contained in:
2019-11-19 11:23:30 -05:00
parent 893ff145c5
commit 373ac01e4e
10 changed files with 33 additions and 9 deletions

View File

@@ -20,7 +20,7 @@ parse_job_t *create_parse_job(const char *filepath, const struct stat *info, int
}
int handle_entry(const char *filepath, const struct stat *info, int typeflag, struct FTW *ftw) {
if (typeflag == FTW_F && S_ISREG(info->st_mode)) {
if (ftw->level <= ScanCtx.depth && typeflag == FTW_F && S_ISREG(info->st_mode)) {
parse_job_t *job = create_parse_job(filepath, info, ftw->base);
tpool_add_work(ScanCtx.pool, parse, job);
}