From 0b3819d16aff2537238e704006add390ba56f477 Mon Sep 17 00:00:00 2001 From: Timothy Stack Date: Sat, 20 Mar 2021 13:54:18 -0700 Subject: [PATCH] [config] check if XDG_CONFIG_HOME exists before using it --- src/lnav_config.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lnav_config.cc b/src/lnav_config.cc index ad4ce6d0..97cbe8ad 100644 --- a/src/lnav_config.cc +++ b/src/lnav_config.cc @@ -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";