[config] check if XDG_CONFIG_HOME exists before using it

This commit is contained in:
Timothy Stack 2021-03-20 13:54:18 -07:00
parent 4f4d90a65d
commit 0b3819d16a
1 changed files with 3 additions and 1 deletions

View File

@ -100,7 +100,9 @@ ghc::filesystem::path dotlnav_path()
if (xdg_config_home != nullptr) {
auto xdg_path = ghc::filesystem::path(xdg_config_home);
return xdg_path / "lnav";
if (ghc::filesystem::is_directory(xdg_path)) {
return xdg_path / "lnav";
}
}
auto home_config = home_path / ".config";