ConfigPath: skip the slash of "~/"
Increment the "path" earlier.
This commit is contained in:
parent
69a5df2f98
commit
7532f24d58
@ -86,13 +86,13 @@ ParsePath(const char *path, Error &error)
|
|||||||
if (path[0] == '~') {
|
if (path[0] == '~') {
|
||||||
Path home = Path::Null();
|
Path home = Path::Null();
|
||||||
|
|
||||||
if (path[1] == '/' || path[1] == '\0') {
|
++path;
|
||||||
|
|
||||||
|
if (*path == '/' || *path == '\0') {
|
||||||
home = GetConfiguredHome(error);
|
home = GetConfiguredHome(error);
|
||||||
|
|
||||||
++path;
|
++path;
|
||||||
} else {
|
} else {
|
||||||
++path;
|
|
||||||
|
|
||||||
const char *slash = strchr(path, '/');
|
const char *slash = strchr(path, '/');
|
||||||
char *user = slash != nullptr
|
char *user = slash != nullptr
|
||||||
? g_strndup(path, slash - path)
|
? g_strndup(path, slash - path)
|
||||||
|
Loading…
Reference in New Issue
Block a user