diff options
author | Max Kellermann <max@duempel.org> | 2013-10-02 08:37:37 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-10-02 08:56:27 +0200 |
commit | b21ed2fa3673cf2fbdc4142c07d60c499e5f877e (patch) | |
tree | 12cd4fd3db87994104bf8d901d8f119466713e43 /src/PlaylistMapper.cxx | |
parent | 0214baad5affb78bf64c7774ba48693a3c6d15ee (diff) | |
download | mpd-b21ed2fa3673cf2fbdc4142c07d60c499e5f877e.tar.gz mpd-b21ed2fa3673cf2fbdc4142c07d60c499e5f877e.tar.xz mpd-b21ed2fa3673cf2fbdc4142c07d60c499e5f877e.zip |
PlaylistMapper: convert playlist name to filesystem charset
Diffstat (limited to '')
-rw-r--r-- | src/PlaylistMapper.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/PlaylistMapper.cxx b/src/PlaylistMapper.cxx index 18ddb0046..b8ea7eb85 100644 --- a/src/PlaylistMapper.cxx +++ b/src/PlaylistMapper.cxx @@ -53,13 +53,14 @@ playlist_open_in_playlist_dir(const char *uri, Mutex &mutex, Cond &cond, if (playlist_directory_fs.IsNull()) return nullptr; - char *path_fs = g_build_filename(playlist_directory_fs.c_str(), uri, - nullptr); + const Path uri_fs = Path::FromUTF8(uri); + if (uri_fs.IsNull()) + return nullptr; - auto playlist = playlist_open_path(path_fs, mutex, cond, is_r); - g_free(path_fs); + const Path path_fs = Path::Build(playlist_directory_fs, uri_fs); + assert(!path_fs.IsNull()); - return playlist; + return playlist_open_path(path_fs.c_str(), mutex, cond, is_r); } /** |