diff options
author | Max Kellermann <max@duempel.org> | 2015-03-05 08:50:26 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-03-05 08:51:01 +0100 |
commit | ddec10d494a7177156bf58c2bb9d2cbffc184918 (patch) | |
tree | ee3131555127abdc72f89a333c1a99410c0d6cc4 /src/input | |
parent | 758e969cb62c92e0e838c4376344cc8d9176c04e (diff) | |
download | mpd-ddec10d494a7177156bf58c2bb9d2cbffc184918.tar.gz mpd-ddec10d494a7177156bf58c2bb9d2cbffc184918.tar.xz mpd-ddec10d494a7177156bf58c2bb9d2cbffc184918.zip |
input/Open: convert UTF-8 to filesystem charset for OpenLocalInputStream()
Diffstat (limited to 'src/input')
-rw-r--r-- | src/input/Open.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/input/Open.cxx b/src/input/Open.cxx index 5f3196709..6bcca0b84 100644 --- a/src/input/Open.cxx +++ b/src/input/Open.cxx @@ -26,6 +26,7 @@ #include "plugins/RewindInputPlugin.hxx" #include "fs/Traits.hxx" #include "fs/Path.hxx" +#include "fs/AllocatedPath.hxx" #include "util/Error.hxx" #include "util/Domain.hxx" @@ -34,10 +35,14 @@ InputStream::Open(const char *url, Mutex &mutex, Cond &cond, Error &error) { - if (PathTraitsUTF8::IsAbsolute(url)) - /* TODO: the parameter is UTF-8, not filesystem charset */ - return OpenLocalInputStream(Path::FromFS(url), + if (PathTraitsUTF8::IsAbsolute(url)) { + const auto path = AllocatedPath::FromUTF8(url, error); + if (path.IsNull()) + return nullptr; + + return OpenLocalInputStream(path, mutex, cond, error); + } input_plugins_for_each_enabled(plugin) { InputStream *is; |