mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Use INSP_FORMAT in ExpandPath.
This commit is contained in:
parent
6c2100a2e4
commit
c446fa0cea
@ -74,9 +74,9 @@ std::string ServerConfig::ServerPaths::ExpandPath(const std::string& base, const
|
|||||||
if (!fragment.compare(0, 2, "~/", 2))
|
if (!fragment.compare(0, 2, "~/", 2))
|
||||||
{
|
{
|
||||||
// The fragment is relative to a home directory, expand that.
|
// The fragment is relative to a home directory, expand that.
|
||||||
const char* homedir = getenv("HOME");
|
const auto* homedir = getenv("HOME");
|
||||||
if (homedir && *homedir)
|
if (homedir && *homedir)
|
||||||
return std::string(homedir) + '/' + fragment.substr(2);
|
return INSP_FORMAT("{}/{}", homedir, fragment.substr(2));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (std::filesystem::path(base).is_relative())
|
if (std::filesystem::path(base).is_relative())
|
||||||
@ -87,7 +87,7 @@ std::string ServerConfig::ServerPaths::ExpandPath(const std::string& base, const
|
|||||||
return INSP_FORMAT("{}/{}/{}", cwd.string(), base, fragment);
|
return INSP_FORMAT("{}/{}/{}", cwd.string(), base, fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
return base + '/' + fragment;
|
return INSP_FORMAT("{}/{}", base, fragment);
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerConfig::ServerConfig()
|
ServerConfig::ServerConfig()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user