diff options
-rw-r--r-- | music.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1,6 +1,7 @@ #include "music.h" #include <glib/gstdio.h> +#include <string.h> struct directory *music_root = NULL; @@ -88,6 +89,9 @@ static struct directory *music_find_dir_rec(struct directory *root, const gchar struct directory *music_find_dir(const gchar *path) { gchar *real_path = g_build_filename(music_root->path, path, NULL); + int len = strlen(real_path); + if(real_path[len - 1] == '/') + real_path[len - 1] = '\0'; struct directory *dir = music_find_dir_rec(music_root, real_path); |