From 26735390fffaa467bf90041a5c380802602affb6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 9 May 2011 18:00:41 +0200 Subject: 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. --- NEWS | 1 + src/playlist_song.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/NEWS b/NEWS index 9dab437d0..fed63b5b1 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ ver 0.16.3 (2011/??/??) * fix assertion failure in audio format mask parser * fix NULL pointer dereference in playlist parser +* fix playlist files in base music directory * decoder: - ffmpeg: support libavcodec 0.7 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 -- cgit v1.2.3