aboutsummaryrefslogtreecommitdiffstats
path: root/src/ConfigPath.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-09-12 11:05:41 +0200
committerMax Kellermann <max@duempel.org>2013-09-12 11:05:41 +0200
commit7532f24d58d3c0aa921adc5314cd3504ba14fd50 (patch)
tree9317c3aa156526cbb45a16adde373971d6c10ea8 /src/ConfigPath.cxx
parent69a5df2f98672b79fe28ba46db5338f132a6555b (diff)
downloadmpd-7532f24d58d3c0aa921adc5314cd3504ba14fd50.tar.gz
mpd-7532f24d58d3c0aa921adc5314cd3504ba14fd50.tar.xz
mpd-7532f24d58d3c0aa921adc5314cd3504ba14fd50.zip
ConfigPath: skip the slash of "~/"
Increment the "path" earlier.
Diffstat (limited to 'src/ConfigPath.cxx')
-rw-r--r--src/ConfigPath.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ConfigPath.cxx b/src/ConfigPath.cxx
index 85739761c..c02f830c5 100644
--- a/src/ConfigPath.cxx
+++ b/src/ConfigPath.cxx
@@ -86,13 +86,13 @@ ParsePath(const char *path, Error &error)
if (path[0] == '~') {
Path home = Path::Null();
- if (path[1] == '/' || path[1] == '\0') {
+ ++path;
+
+ if (*path == '/' || *path == '\0') {
home = GetConfiguredHome(error);
++path;
} else {
- ++path;
-
const char *slash = strchr(path, '/');
char *user = slash != nullptr
? g_strndup(path, slash - path)