From 8a6bb54eb5167c211fec3634b6ed9847b80677b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sun, 26 Sep 2021 08:59:57 +0200 Subject: Ignore empty XDG_CONFIG_DIRS As the specification says we should. GLib does this as well. It is still possible to achieve an empty set by using ":", which are two non-absolute paths that should be ignored. GLib doesn't implement this. Thus, we're now better than GLib. --- sdn.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sdn.cpp') diff --git a/sdn.cpp b/sdn.cpp index ddcb342..3c4a407 100644 --- a/sdn.cpp +++ b/sdn.cpp @@ -268,7 +268,7 @@ fun xdg_config_home () -> string { fun xdg_config_find (const string &suffix) -> unique_ptr { vector dirs {xdg_config_home ()}; const char *system_dirs = getenv ("XDG_CONFIG_DIRS"); - split (system_dirs ? system_dirs : "/etc/xdg", ":", dirs); + split ((system_dirs && *system_dirs) ? system_dirs : "/etc/xdg", ":", dirs); for (const auto &dir : dirs) { if (dir[0] != '/') continue; -- cgit v1.2.3