From 91a6fb81c1d0648687c8602be90650d5330c2128 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 5 Mar 2015 08:55:13 +0100 Subject: [PATCH] PlaylistStream: convert suffix to UTF-8 --- src/playlist/PlaylistStream.cxx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/playlist/PlaylistStream.cxx b/src/playlist/PlaylistStream.cxx index b0febba2b..99e1c3182 100644 --- a/src/playlist/PlaylistStream.cxx +++ b/src/playlist/PlaylistStream.cxx @@ -35,8 +35,12 @@ playlist_open_path_suffix(Path path, Mutex &mutex, Cond &cond) { assert(!path.IsNull()); - const char *suffix = path.GetSuffix(); - if (suffix == nullptr || !playlist_suffix_supported(suffix)) + const auto *suffix = path.GetSuffix(); + if (suffix == nullptr) + return nullptr; + + const auto suffix_utf8 = Path::FromFS(suffix).ToUTF8(); + if (!playlist_suffix_supported(suffix_utf8.c_str())) return nullptr; Error error; @@ -46,7 +50,8 @@ playlist_open_path_suffix(Path path, Mutex &mutex, Cond &cond) return nullptr; } - auto playlist = playlist_list_open_stream_suffix(*is, suffix); + auto playlist = playlist_list_open_stream_suffix(*is, + suffix_utf8.c_str()); if (playlist != nullptr) playlist = new CloseSongEnumerator(playlist, is); else