Properly handle recursion in recurse()
The restructuring of recurse() in the last few weeks actually broke the recursion-flags in different tools. As a long-term goal, the recursor should have a field "maxdepth" which should be "1" for the non-Rflag-case. "0" stands for unlimited.
This commit is contained in:
@@ -37,7 +37,7 @@ recurse(const char *path, void *data, struct recursor *r)
|
||||
recurse_status = 1;
|
||||
return;
|
||||
}
|
||||
if (!S_ISDIR(st.st_mode)) {
|
||||
if (!S_ISDIR(st.st_mode) || (S_ISDIR(st.st_mode) && (r->flags & NODIRS))) {
|
||||
(r->fn)(path, &st, data, r);
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user