db/Configured: convert path to UTF-8 before injecting into configuration

This commit is contained in:
Max Kellermann 2015-03-05 08:38:45 +01:00
parent 59dd8ffbc6
commit a9a6a5041b

View File

@ -60,9 +60,12 @@ CreateConfiguredDatabase(EventLoop &loop, DatabaseListener &listener,
return nullptr;
const auto db_file = AllocatedPath::Build(cache_dir, "mpd.db");
const auto db_file_utf8 = db_file.ToUTF8();
if (db_file_utf8.empty())
return nullptr;
allocated = new ConfigBlock();
allocated->AddBlockParam("path", db_file.c_str(), -1);
allocated->AddBlockParam("path", db_file_utf8.c_str(), -1);
param = allocated;
}