Properly expand '~' in mpd_host when preceded by a password.
This commit is contained in:
@@ -63,8 +63,12 @@ std::string xdg_config_home()
|
|||||||
void expand_home(std::string &path)
|
void expand_home(std::string &path)
|
||||||
{
|
{
|
||||||
assert(env_home != nullptr);
|
assert(env_home != nullptr);
|
||||||
if (!path.empty() && path[0] == '~')
|
if (!path.empty())
|
||||||
path.replace(0, 1, env_home);
|
{
|
||||||
|
size_t i = path.find("~");
|
||||||
|
if (i != std::string::npos && (i == 0 || path[i - 1] == '@'))
|
||||||
|
path.replace(i, 1, env_home);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool configure(int argc, char **argv)
|
bool configure(int argc, char **argv)
|
||||||
|
|||||||
Reference in New Issue
Block a user