PlaylistFile: always check for absolute paths within music_directory

Try map_fs_to_utf8() first, and fall back to Path::ToUTF8() for
absolute paths.
This commit is contained in:
Max Kellermann 2013-10-14 22:21:22 +02:00
parent 0b27ac2f5c
commit 62271bf6ce

View File

@ -243,16 +243,18 @@ LoadPlaylistFile(const char *utf8path, Error &error)
std::string uri_utf8; std::string uri_utf8;
if (!uri_has_scheme(s)) {
uri_utf8 = map_fs_to_utf8(s);
if (uri_utf8.empty()) {
if (g_path_is_absolute(s)) { if (g_path_is_absolute(s)) {
uri_utf8 = Path::ToUTF8(s); uri_utf8 = Path::ToUTF8(s);
if (uri_utf8.empty()) if (uri_utf8.empty())
continue; continue;
uri_utf8.insert(0, "file://"); uri_utf8.insert(0, "file://");
} else if (!uri_has_scheme(s)) { } else
uri_utf8 = map_fs_to_utf8(s);
if (uri_utf8.empty())
continue; continue;
}
} else { } else {
uri_utf8 = Path::ToUTF8(s); uri_utf8 = Path::ToUTF8(s);
if (uri_utf8.empty()) if (uri_utf8.empty())