diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-16 01:20:28 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2010-08-16 01:20:28 +0200 |
commit | cf06ede0b2404350d6e2bcb6900e7363072ebb9c (patch) | |
tree | af6858500b4670d8c1a0231bb690305489636de2 | |
parent | aea0cac331fec86fba20dba096bb0e22c0e3f977 (diff) |
Fully (badly) implemented music_find_dir_rec().
-rw-r--r-- | music.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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; } |