Merge pull request #327 from FeralHedgehog/expand_with_password

Expand '~' in mpd_host when preceded by a password.
master
Larson Carter 7 years ago committed by GitHub
commit 94bfe04994
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/configuration.cpp

@ -63,8 +63,12 @@ std::string xdg_config_home()
void expand_home(std::string &path)
{
assert(env_home != nullptr);
if (!path.empty() && path[0] == '~')
path.replace(0, 1, env_home);
if (!path.empty())
{
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)

Loading…
Cancel
Save