aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-10-14 22:21:22 +0200
committerMax Kellermann <max@duempel.org>2013-10-14 22:21:22 +0200
commit62271bf6ce52804a944bf33d45cdab9fac37f93c (patch)
tree2d0757eaaa972d1f5dc0149e1f2dd1160453c8b0
parent0b27ac2f5c6a352be733f00e873ceb9d0904e92a (diff)
downloadmpd-62271bf6ce52804a944bf33d45cdab9fac37f93c.tar.gz
mpd-62271bf6ce52804a944bf33d45cdab9fac37f93c.tar.xz
mpd-62271bf6ce52804a944bf33d45cdab9fac37f93c.zip
PlaylistFile: always check for absolute paths within music_directory
Try map_fs_to_utf8() first, and fall back to Path::ToUTF8() for absolute paths.
Diffstat (limited to '')
-rw-r--r--src/PlaylistFile.cxx20
1 files 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())