summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--music.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/music.c b/music.c
index 321481c..c68504d 100644
--- a/music.c
+++ b/music.c
@@ -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);