aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2015-03-05 08:38:45 +0100
committerMax Kellermann <max@duempel.org>2015-03-05 08:38:50 +0100
commita9a6a5041bc3ce3c00abd2e00a9ecf6466bcd269 (patch)
treee153c039ec58e11ea952509456e869c1bc2de49e /src/db
parent59dd8ffbc6d811c28dc0f127cb89d548d3e3ce2c (diff)
downloadmpd-a9a6a5041bc3ce3c00abd2e00a9ecf6466bcd269.tar.gz
mpd-a9a6a5041bc3ce3c00abd2e00a9ecf6466bcd269.tar.xz
mpd-a9a6a5041bc3ce3c00abd2e00a9ecf6466bcd269.zip
db/Configured: convert path to UTF-8 before injecting into configuration
Diffstat (limited to 'src/db')
-rw-r--r--src/db/Configured.cxx5
1 files changed, 4 insertions, 1 deletions
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;
}