diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-09-26 08:59:57 +0200 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-09-26 08:59:57 +0200 |
commit | 8a6bb54eb5167c211fec3634b6ed9847b80677b6 (patch) | |
tree | 1e77135958be196fba054a187ee1b5a9857a010a | |
parent | 4ef7c9edf7e37c41712520a1b4acf3b490094629 (diff) | |
download | sdn-8a6bb54eb5167c211fec3634b6ed9847b80677b6.tar.gz sdn-8a6bb54eb5167c211fec3634b6ed9847b80677b6.tar.xz sdn-8a6bb54eb5167c211fec3634b6ed9847b80677b6.zip |
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.
-rw-r--r-- | sdn.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -268,7 +268,7 @@ fun xdg_config_home () -> string { fun xdg_config_find (const string &suffix) -> unique_ptr<ifstream> { vector<string> 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; |