aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-09-13 20:41:06 +0200
committerMax Kellermann <max@duempel.org>2011-09-13 20:44:00 +0200
commit2ff35c8bfa18d1ada10ef2b82012d39bd19a972a (patch)
tree2d79a2512769a727290c0559473f80538e4b1fd5 /src/directory.c
parent169db88c20dc7601f8589cfa298254c932f0947a (diff)
downloadmpd-2ff35c8bfa18d1ada10ef2b82012d39bd19a972a.tar.gz
mpd-2ff35c8bfa18d1ada10ef2b82012d39bd19a972a.tar.xz
mpd-2ff35c8bfa18d1ada10ef2b82012d39bd19a972a.zip
directory: don't require a "directory" visitor
.. to recurse. A visitor may not have one, but still be interested in a recursive search.
Diffstat (limited to 'src/directory.c')
-rw-r--r--src/directory.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/directory.c b/src/directory.c
index eb076d94d..515b07e7d 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -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;