From 052f74f4db45219d731e7af6dcb9beb5eec2344c Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 17 Aug 2010 23:57:38 +0200 Subject: Use relative paths when interacting with the music_* functions. --- music.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'music.c') diff --git a/music.c b/music.c index 7a4b37e..321481c 100644 --- a/music.c +++ b/music.c @@ -87,7 +87,13 @@ static struct directory *music_find_dir_rec(struct directory *root, const gchar } struct directory *music_find_dir(const gchar *path) { - return music_find_dir_rec(music_root, path); + gchar *real_path = g_build_filename(music_root->path, path, NULL); + + struct directory *dir = music_find_dir_rec(music_root, real_path); + + g_free(real_path); + + return dir; } struct file *music_find_file(const gchar *path) { @@ -138,3 +144,7 @@ void music_free() { music_do_free(music_root); music_root = NULL; } + +gchar *music_get_full_path(const gchar *path) { + return g_build_filename(music_root->path, path, NULL); +} -- cgit v1.2.3