ConfigPath: return early on "~"
Previously, the pointer was moved to undefined memory.
This commit is contained in:
parent
7532f24d58
commit
89d2d648cc
@ -84,11 +84,14 @@ ParsePath(const char *path, Error &error)
|
||||
|
||||
#ifndef WIN32
|
||||
if (path[0] == '~') {
|
||||
Path home = Path::Null();
|
||||
|
||||
++path;
|
||||
|
||||
if (*path == '/' || *path == '\0') {
|
||||
if (*path == '\0')
|
||||
return GetConfiguredHome(error);
|
||||
|
||||
Path home = Path::Null();
|
||||
|
||||
if (*path == '/') {
|
||||
home = GetConfiguredHome(error);
|
||||
|
||||
++path;
|
||||
|
Loading…
Reference in New Issue
Block a user