diff options
author | Max Kellermann <max@duempel.org> | 2015-03-03 13:16:45 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2015-03-03 13:18:15 +0100 |
commit | cf073de36c77adc6dd28862a0cab3a81a461b9f2 (patch) | |
tree | 86cee489994233ae84221cf864da39a933595877 /src/db | |
parent | f16054639ba251067b47ec4b92c06e69f93d8e1f (diff) | |
download | mpd-cf073de36c77adc6dd28862a0cab3a81a461b9f2.tar.gz mpd-cf073de36c77adc6dd28862a0cab3a81a461b9f2.tar.xz mpd-cf073de36c77adc6dd28862a0cab3a81a461b9f2.zip |
storage/local: convert mangled URI to FS charset
Diffstat (limited to 'src/db')
-rw-r--r-- | src/db/plugins/simple/SimpleDatabasePlugin.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/db/plugins/simple/SimpleDatabasePlugin.cxx b/src/db/plugins/simple/SimpleDatabasePlugin.cxx index 39dbcf8b7..27965c0eb 100644 --- a/src/db/plugins/simple/SimpleDatabasePlugin.cxx +++ b/src/db/plugins/simple/SimpleDatabasePlugin.cxx @@ -483,11 +483,15 @@ SimpleDatabase::Mount(const char *local_uri, const char *storage_uri, std::string name(storage_uri); std::replace_if(name.begin(), name.end(), IsUnsafeChar, '_'); + const auto name_fs = AllocatedPath::FromUTF8(name.c_str(), error); + if (name_fs.IsNull()) + return false; + #ifndef ENABLE_ZLIB constexpr bool compress = false; #endif auto db = new SimpleDatabase(AllocatedPath::Build(cache_path, - name.c_str()), + name_fs.c_str()), compress); if (!db->Open(error)) { delete db; |