summaryrefslogtreecommitdiff
path: root/music.c
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-08-16 01:20:28 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-08-16 01:20:28 +0200
commitcf06ede0b2404350d6e2bcb6900e7363072ebb9c (patch)
treeaf6858500b4670d8c1a0231bb690305489636de2 /music.c
parentaea0cac331fec86fba20dba096bb0e22c0e3f977 (diff)
Fully (badly) implemented music_find_dir_rec().
Diffstat (limited to 'music.c')
-rw-r--r--music.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/music.c b/music.c
index 09ee7d8..8852835 100644
--- a/music.c
+++ b/music.c
@@ -82,8 +82,16 @@ static struct directory *music_find_dir_rec(struct directory *root, const gchar
if(g_strcmp0(root->path, path) == 0)
return root;
- /* TODO: implement this */
- g_error("not implemented");
+ for(struct directory *d = root->sub; d; d = d->next) {
+ if(g_strcmp0(d->path, path) == 0) {
+ return d;
+ }
+
+ struct directory *temp = music_find_dir_rec(d, path);
+ if(temp) {
+ return temp;
+ }
+ }
return NULL;
}