diff options
author | Max Kellermann <max@duempel.org> | 2013-01-17 00:56:57 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-18 15:34:01 +0100 |
commit | e5039c478aa93e3e107ee9031a3cf27a6c203fea (patch) | |
tree | 5d9fecc644b915fe02634911d65c29123e03c1b8 /src/db/SimpleDatabasePlugin.cxx | |
parent | 890151450663abd581cab56e853e8e713d822851 (diff) | |
download | mpd-e5039c478aa93e3e107ee9031a3cf27a6c203fea.tar.gz mpd-e5039c478aa93e3e107ee9031a3cf27a6c203fea.tar.xz mpd-e5039c478aa93e3e107ee9031a3cf27a6c203fea.zip |
Path: new class "Path" wraps filesystem path strings
Diffstat (limited to '')
-rw-r--r-- | src/db/SimpleDatabasePlugin.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/db/SimpleDatabasePlugin.cxx b/src/db/SimpleDatabasePlugin.cxx index 8eea81e30..b7c60d9d8 100644 --- a/src/db/SimpleDatabasePlugin.cxx +++ b/src/db/SimpleDatabasePlugin.cxx @@ -68,7 +68,7 @@ SimpleDatabase::Configure(const struct config_param *param, GError **error_r) return false; } - path = _path; + path = Path::FromUTF8(_path); free(_path); return true; @@ -77,6 +77,7 @@ SimpleDatabase::Configure(const struct config_param *param, GError **error_r) bool SimpleDatabase::Check(GError **error_r) const { + assert(!path.IsNull()); assert(!path.empty()); /* Check if the file exists */ @@ -153,7 +154,7 @@ SimpleDatabase::Load(GError **error_r) assert(!path.empty()); assert(root != NULL); - TextFile file(path.c_str()); + TextFile file(path); if (file.HasFailed()) { g_set_error(error_r, simple_db_quark(), errno, "Failed to open database file \"%s\": %s", |