aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistSong.cxx
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/PlaylistSong.cxx16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/PlaylistSong.cxx b/src/PlaylistSong.cxx
index 60774dc36..084f534ad 100644
--- a/src/PlaylistSong.cxx
+++ b/src/PlaylistSong.cxx
@@ -99,7 +99,7 @@ playlist_check_load_song(const Song *song, const char *uri, bool secure)
if (uri_has_scheme(uri)) {
dest = Song::NewRemote(uri);
- } else if (PathTraits::IsAbsoluteUTF8(uri) && secure) {
+ } else if (PathTraitsUTF8::IsAbsolute(uri) && secure) {
dest = Song::LoadFile(uri, nullptr);
if (dest == nullptr)
return nullptr;
@@ -142,13 +142,13 @@ playlist_check_translate_song(Song *song, const char *base_uri,
}
if (base_uri != nullptr && strcmp(base_uri, ".") == 0)
- /* PathTraits::GetParentUTF8() returns "." when there
+ /* PathTraitsUTF8::GetParent() returns "." when there
is no directory name in the given path; clear that
now, because it would break the database lookup
functions */
base_uri = nullptr;
- if (PathTraits::IsAbsoluteUTF8(uri)) {
+ if (PathTraitsUTF8::IsAbsolute(uri)) {
/* XXX fs_charset vs utf8? */
const char *suffix = map_to_relative_path(uri);
assert(suffix != nullptr);
@@ -165,12 +165,14 @@ playlist_check_translate_song(Song *song, const char *base_uri,
base_uri = nullptr;
}
- char *allocated = nullptr;
- if (base_uri != nullptr)
- uri = allocated = g_build_filename(base_uri, uri, nullptr);
+ std::string full_uri;
+ if (base_uri != nullptr) {
+ full_uri = PathTraitsUTF8::Build(base_uri, uri);
+ uri = full_uri.c_str();
+ }
Song *dest = playlist_check_load_song(song, uri, secure);
song->Free();
- g_free(allocated);
+
return dest;
}