From acc1bd6297ed4550f2e567aa2d2d27ffc6784629 Mon Sep 17 00:00:00 2001 From: "James D. Smith" Date: Sat, 27 Jun 2020 18:14:23 -0600 Subject: [PATCH] playlist/PlaylistSong: Remove dots from playlist file paths. --- src/playlist/PlaylistSong.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/playlist/PlaylistSong.cxx b/src/playlist/PlaylistSong.cxx index 349282456..3e205ee43 100644 --- a/src/playlist/PlaylistSong.cxx +++ b/src/playlist/PlaylistSong.cxx @@ -24,6 +24,7 @@ #include "fs/Traits.hxx" #include "song/DetachedSong.hxx" #include "util/UriExtract.hxx" +#include "util/UriUtil.hxx" #include #include @@ -96,8 +97,14 @@ playlist_check_translate_song(DetachedSong &song, std::string_view base_uri, #endif if (base_uri.data() != nullptr && - !PathTraitsUTF8::IsAbsoluteOrHasScheme(uri)) + !PathTraitsUTF8::IsAbsoluteOrHasScheme(uri)) { song.SetURI(PathTraitsUTF8::Build(base_uri, uri)); + uri = song.GetURI(); + } + + /* Remove dot segments */ + std::string new_uri = uri_squash_dot_segments(uri); + song.SetURI(std::move(new_uri)); return playlist_check_load_song(song, loader); }