Context: Correctly handle XDG_CONFIG_HOME paths ending with '/'

This commit is contained in:
Tomas Babej 2020-12-10 23:49:00 -05:00
parent f0e34a7ef7
commit eb32c9d8d7
No known key found for this signature in database
GPG key ID: B0747C6578F7D2F5

View file

@ -471,6 +471,10 @@ int Context::initialize (int argc, const char** argv)
else
xdg_config_home = format ("{1}/.config", home_dir);
// Ensure the path does not end with '/'
if (xdg_config_home.back () == '/')
xdg_config_home.pop_back();
// https://github.com/GothenburgBitFactory/libshared/issues/32
std::string rcfile_path = format ("{1}/task/taskrc", xdg_config_home);