aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConfigGlobal.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-08-07 19:54:38 +0200
committerMax Kellermann <max@duempel.org>2013-08-07 19:59:09 +0200
commitb76a29a69ae5412c3c1d101eefa9562990e74407 (patch)
tree5c60aa1bb5e6a8d134707291d12fb4ebb77c06c8 /src/ConfigGlobal.cxx
parentabe090ec1f2255ce422f74e5b59bffc83aaff875 (diff)
downloadmpd-b76a29a69ae5412c3c1d101eefa9562990e74407.tar.gz
mpd-b76a29a69ae5412c3c1d101eefa9562990e74407.tar.xz
mpd-b76a29a69ae5412c3c1d101eefa9562990e74407.zip
ConfigPath: return a Path object
Migrate all callers to use Path directly, instead of doing the conversion in each caller.
Diffstat (limited to 'src/ConfigGlobal.cxx')
-rw-r--r--src/ConfigGlobal.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ConfigGlobal.cxx b/src/ConfigGlobal.cxx
index a66c03748..1f89a1283 100644
--- a/src/ConfigGlobal.cxx
+++ b/src/ConfigGlobal.cxx
@@ -23,6 +23,7 @@
#include "ConfigData.hxx"
#include "ConfigFile.hxx"
#include "ConfigPath.hxx"
+#include "fs/Path.hxx"
#include "mpd_error.h"
#include <glib.h>
@@ -96,18 +97,18 @@ config_get_string(ConfigOption option, const char *default_value)
return param->value;
}
-char *
-config_dup_path(ConfigOption option, GError **error_r)
+Path
+config_get_path(ConfigOption option, GError **error_r)
{
assert(error_r != NULL);
assert(*error_r == NULL);
const struct config_param *param = config_get_param(option);
if (param == NULL)
- return NULL;
+ return Path::Null();
- char *path = parsePath(param->value, error_r);
- if (G_UNLIKELY(path == NULL))
+ Path path = ParsePath(param->value, error_r);
+ if (gcc_unlikely(path.IsNull()))
g_prefix_error(error_r,
"Invalid path at line %i: ",
param->line);