replace ~ in mpd_music_dir with user's home directory
This commit is contained in:
@@ -517,8 +517,13 @@ void ReadConfiguration(ncmpcpp_config &conf)
|
|||||||
else if (cl.find("mpd_music_dir") != string::npos)
|
else if (cl.find("mpd_music_dir") != string::npos)
|
||||||
{
|
{
|
||||||
if (!v.empty())
|
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 + "/";
|
conf.mpd_music_dir = v + "/";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (cl.find("mpd_port") != string::npos)
|
else if (cl.find("mpd_port") != string::npos)
|
||||||
{
|
{
|
||||||
if (StrToInt(v))
|
if (StrToInt(v))
|
||||||
|
|||||||
Reference in New Issue
Block a user