aboutsummaryrefslogtreecommitdiffstats
path: root/src/directory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/directory.c')
-rw-r--r--src/directory.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/directory.c b/src/directory.c
index 515b07e7d..83fefb8c4 100644
--- a/src/directory.c
+++ b/src/directory.c
@@ -177,10 +177,6 @@ directory_walk(struct directory *directory,
assert(visitor != NULL);
assert(error_r == NULL || *error_r == NULL);
- if (visitor->directory != NULL &&
- !visitor->directory(directory, ctx, error_r))
- return false;
-
if (visitor->song != NULL) {
struct songvec *sv = &directory->songs;
for (size_t i = 0; i < sv->nr; ++i)
@@ -192,6 +188,10 @@ directory_walk(struct directory *directory,
for (size_t i = 0; i < dv->nr; ++i) {
struct directory *child = dv->base[i];
+ if (visitor->directory != NULL &&
+ !visitor->directory(child, ctx, error_r))
+ return false;
+
if (!directory_walk(child, visitor, ctx, error_r))
return false;
}