diff options
author | Max Kellermann <max@duempel.org> | 2015-02-28 23:50:18 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-02-28 23:50:18 +0100 |
commit | 77e163e5b859326c1be2a3649c38542881475d26 (patch) | |
tree | a356b1ffb8b6d39ab71927078b6f3a8b1a071835 | |
parent | 0e00b9009d1cce5a25f4684dee83bee91ff4da34 (diff) | |
download | mpd-77e163e5b859326c1be2a3649c38542881475d26.tar.gz mpd-77e163e5b859326c1be2a3649c38542881475d26.tar.xz mpd-77e163e5b859326c1be2a3649c38542881475d26.zip |
Mapper: use Path::IsAbsolute()
Diffstat (limited to '')
-rw-r--r-- | src/Mapper.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/Mapper.cxx b/src/Mapper.cxx index e6c7a248a..fced7ae19 100644 --- a/src/Mapper.cxx +++ b/src/Mapper.cxx @@ -86,11 +86,9 @@ map_uri_fs(const char *uri) } std::string -map_fs_to_utf8(Path _path_fs) +map_fs_to_utf8(Path path_fs) { - auto path_fs = _path_fs.c_str(); - - if (PathTraitsFS::IsSeparator(path_fs[0])) { + if (path_fs.IsAbsolute()) { if (instance->storage == nullptr) return std::string(); @@ -98,12 +96,14 @@ map_fs_to_utf8(Path _path_fs) if (music_dir_fs.IsNull()) return std::string(); - path_fs = music_dir_fs.Relative(_path_fs); - if (path_fs == nullptr || *path_fs == 0) + auto relative = music_dir_fs.Relative(path_fs); + if (relative == nullptr || *relative == 0) return std::string(); + + path_fs = Path::FromFS(relative); } - return PathToUTF8(path_fs); + return path_fs.ToUTF8(); } #endif |