ConfigPath: use std::string
This commit is contained in:
parent
39e2ffe212
commit
7db124068f
@ -99,12 +99,11 @@ ParsePath(const char *path, Error &error)
|
|||||||
++path;
|
++path;
|
||||||
} else {
|
} else {
|
||||||
const char *slash = strchr(path, '/');
|
const char *slash = strchr(path, '/');
|
||||||
char *user = slash != nullptr
|
const char *end = slash == nullptr
|
||||||
? g_strndup(path, slash - path)
|
? path + strlen(path)
|
||||||
: g_strdup(path);
|
: slash;
|
||||||
|
const std::string user(path, end);
|
||||||
home = GetHome(user, error);
|
home = GetHome(user.c_str(), error);
|
||||||
g_free(user);
|
|
||||||
|
|
||||||
if (slash == nullptr)
|
if (slash == nullptr)
|
||||||
return home;
|
return home;
|
||||||
|
Loading…
Reference in New Issue
Block a user