directory: don't require a "directory" visitor
.. to recurse. A visitor may not have one, but still be interested in a recursive search.
This commit is contained in:
parent
169db88c20
commit
2ff35c8bfa
@ -188,12 +188,12 @@ directory_walk(struct directory *directory,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (visitor->directory != NULL) {
|
const struct dirvec *dv = &directory->children;
|
||||||
const struct dirvec *dv = &directory->children;
|
for (size_t i = 0; i < dv->nr; ++i) {
|
||||||
for (size_t i = 0; i < dv->nr; ++i)
|
struct directory *child = dv->base[i];
|
||||||
if (!directory_walk(dv->base[i], visitor, ctx,
|
|
||||||
error_r))
|
if (!directory_walk(child, visitor, ctx, error_r))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user