From 62271bf6ce52804a944bf33d45cdab9fac37f93c Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 14 Oct 2013 22:21:22 +0200 Subject: [PATCH] PlaylistFile: always check for absolute paths within music_directory Try map_fs_to_utf8() first, and fall back to Path::ToUTF8() for absolute paths. --- src/PlaylistFile.cxx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/PlaylistFile.cxx b/src/PlaylistFile.cxx index 7b81d7354..6085020e0 100644 --- a/src/PlaylistFile.cxx +++ b/src/PlaylistFile.cxx @@ -243,16 +243,18 @@ LoadPlaylistFile(const char *utf8path, Error &error) std::string uri_utf8; - if (g_path_is_absolute(s)) { - uri_utf8 = Path::ToUTF8(s); - if (uri_utf8.empty()) - continue; - - uri_utf8.insert(0, "file://"); - } else if (!uri_has_scheme(s)) { + if (!uri_has_scheme(s)) { uri_utf8 = map_fs_to_utf8(s); - if (uri_utf8.empty()) - continue; + if (uri_utf8.empty()) { + if (g_path_is_absolute(s)) { + uri_utf8 = Path::ToUTF8(s); + if (uri_utf8.empty()) + continue; + + uri_utf8.insert(0, "file://"); + } else + continue; + } } else { uri_utf8 = Path::ToUTF8(s); if (uri_utf8.empty())