From a9a6a5041bc3ce3c00abd2e00a9ecf6466bcd269 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 5 Mar 2015 08:38:45 +0100 Subject: db/Configured: convert path to UTF-8 before injecting into configuration --- src/db/Configured.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/db') diff --git a/src/db/Configured.cxx b/src/db/Configured.cxx index 9ada7f34a..5d95b3e70 100644 --- a/src/db/Configured.cxx +++ b/src/db/Configured.cxx @@ -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; } -- cgit v1.2.3