replace ~ in mpd_music_dir with user's home directory

This commit is contained in:
Andrzej Rybczak
2009-02-01 20:49:07 +01:00
parent 966fd634a4
commit 6e2a6dfd27

View File

@@ -517,7 +517,12 @@ void ReadConfiguration(ncmpcpp_config &conf)
else if (cl.find("mpd_music_dir") != string::npos)
{
if (!v.empty())
{
// if ~ is used at the beginning, replace it with user's home folder
if (v[0] == '~')
v.replace(0, 1, home_folder);
conf.mpd_music_dir = v + "/";
}
}
else if (cl.find("mpd_port") != string::npos)
{