ConfigPath: skip the slash of "~/"

Increment the "path" earlier.
This commit is contained in:
Max Kellermann 2013-09-12 11:05:41 +02:00
parent 69a5df2f98
commit 7532f24d58

View File

@ -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)