From 7532f24d58d3c0aa921adc5314cd3504ba14fd50 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 12 Sep 2013 11:05:41 +0200 Subject: ConfigPath: skip the slash of "~/" Increment the "path" earlier. --- src/ConfigPath.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ConfigPath.cxx') 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) -- cgit v1.2.3