Commit 7db12406 authored by Max Kellermann's avatar Max Kellermann

ConfigPath: use std::string

parent 39e2ffe2
......@@ -99,12 +99,11 @@ ParsePath(const char *path, Error &error)
++path;
} else {
const char *slash = strchr(path, '/');
char *user = slash != nullptr
? g_strndup(path, slash - path)
: g_strdup(path);
home = GetHome(user, error);
g_free(user);
const char *end = slash == nullptr
? path + strlen(path)
: slash;
const std::string user(path, end);
home = GetHome(user.c_str(), error);
if (slash == nullptr)
return home;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment