ConfigPath: return early on "~"

Previously, the pointer was moved to undefined memory.
This commit is contained in:
Max Kellermann 2013-09-12 11:04:57 +02:00
parent 7532f24d58
commit 89d2d648cc

View File

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