aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-14 02:12:36 +0200
committerMax Kellermann <max@duempel.org>2012-08-14 02:25:19 +0200
commitadcd2c8eacd74aeb072b806a3c36922ca2ad753d (patch)
treecbb29b87d221307728e5b6fef0c4ff4fdcbb806c
parent45ff3558358827ea60f6c0c8f2335e20c07293ed (diff)
downloadmpd-adcd2c8eacd74aeb072b806a3c36922ca2ad753d.tar.gz
mpd-adcd2c8eacd74aeb072b806a3c36922ca2ad753d.tar.xz
mpd-adcd2c8eacd74aeb072b806a3c36922ca2ad753d.zip
playlist_song: use map_to_relative_path()
Diffstat (limited to '')
-rw-r--r--src/playlist_song.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/playlist_song.c b/src/playlist_song.c
index 019ea8c55..88ef1059d 100644
--- a/src/playlist_song.c
+++ b/src/playlist_song.c
@@ -134,11 +134,11 @@ playlist_check_translate_song(struct song *song, const char *base_uri,
if (g_path_is_absolute(uri)) {
/* XXX fs_charset vs utf8? */
- const char *prefix = mapper_get_music_directory();
+ const char *suffix = map_to_relative_path(uri);
+ assert(suffix != NULL);
- if (prefix != NULL && g_str_has_prefix(uri, prefix) &&
- uri[strlen(prefix)] == '/')
- uri += strlen(prefix) + 1;
+ if (suffix != uri)
+ uri = suffix;
else if (!secure) {
/* local files must be relative to the music
directory when "secure" is enabled */