From eb32c9d8d78cbb397f38256997d6649347a7831b Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Thu, 10 Dec 2020 23:49:00 -0500 Subject: [PATCH] Context: Correctly handle XDG_CONFIG_HOME paths ending with '/' --- src/Context.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Context.cpp b/src/Context.cpp index c56a9256e..e7578c0a1 100644 --- a/src/Context.cpp +++ b/src/Context.cpp @@ -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);