aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_song.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-05-09 18:00:41 +0200
committerMax Kellermann <max@duempel.org>2011-05-09 18:05:11 +0200
commit26735390fffaa467bf90041a5c380802602affb6 (patch)
tree6ebb28de3f3efd11617208f054568c7763968ee4 /src/playlist_song.c
parent9402b23dd5f75388cb48fdf04ca62033dfc6709a (diff)
downloadmpd-26735390fffaa467bf90041a5c380802602affb6.tar.gz
mpd-26735390fffaa467bf90041a5c380802602affb6.tar.xz
mpd-26735390fffaa467bf90041a5c380802602affb6.zip
playlist_song: fix playlist files in base music directory
g_path_get_dirname() returns "." when there is no directory name in the given path. This patch adds a workaround for that.
Diffstat (limited to 'src/playlist_song.c')
-rw-r--r--src/playlist_song.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/playlist_song.c b/src/playlist_song.c
index 2ad63c913..1a543a0b8 100644
--- a/src/playlist_song.c
+++ b/src/playlist_song.c
@@ -105,6 +105,13 @@ playlist_check_translate_song(struct song *song, const char *base_uri)
}
}
+ if (base_uri != NULL && strcmp(base_uri, ".") == 0)
+ /* g_path_get_dirname() returns "." when there is no
+ directory name in the given path; clear that now,
+ because it would break the database lookup
+ functions */
+ base_uri = NULL;
+
if (g_path_is_absolute(uri)) {
/* XXX fs_charset vs utf8? */
char *prefix = base_uri != NULL