diff options
author | Max Kellermann <max@duempel.org> | 2013-09-12 11:05:41 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-09-12 11:05:41 +0200 |
commit | 7532f24d58d3c0aa921adc5314cd3504ba14fd50 (patch) | |
tree | 9317c3aa156526cbb45a16adde373971d6c10ea8 | |
parent | 69a5df2f98672b79fe28ba46db5338f132a6555b (diff) | |
download | mpd-7532f24d58d3c0aa921adc5314cd3504ba14fd50.tar.gz mpd-7532f24d58d3c0aa921adc5314cd3504ba14fd50.tar.xz mpd-7532f24d58d3c0aa921adc5314cd3504ba14fd50.zip |
ConfigPath: skip the slash of "~/"
Increment the "path" earlier.
Diffstat (limited to '')
-rw-r--r-- | src/ConfigPath.cxx | 6 |
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) |