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:
Max Kellermann 2011-09-13 20:41:06 +02:00
parent 169db88c20
commit 2ff35c8bfa

View File

@ -188,12 +188,12 @@ directory_walk(struct directory *directory,
return false;
}
if (visitor->directory != NULL) {
const struct dirvec *dv = &directory->children;
for (size_t i = 0; i < dv->nr; ++i)
if (!directory_walk(dv->base[i], visitor, ctx,
error_r))
return false;
const struct dirvec *dv = &directory->children;
for (size_t i = 0; i < dv->nr; ++i) {
struct directory *child = dv->base[i];
if (!directory_walk(child, visitor, ctx, error_r))
return false;
}
return true;