From cf06ede0b2404350d6e2bcb6900e7363072ebb9c Mon Sep 17 00:00:00 2001
From: Jon Bergli Heier <snakebite@jvnv.net>
Date: Mon, 16 Aug 2010 01:20:28 +0200
Subject: Fully (badly) implemented music_find_dir_rec().

---
 music.c | 12 ++++++++++--
 1 file 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;
 }
-- 
cgit v1.2.3