From 20608c987b1668cb2b4e3cff7615577cd05c2075 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 6 Apr 2022 18:44:09 +0200 Subject: config: fallback to /etc/xdg if XDG_CONFIG_DIRS is unset Closes #1008 --- config.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'config.c') diff --git a/config.c b/config.c index 513d5032..d7bdc8d8 100644 --- a/config.c +++ b/config.c @@ -444,10 +444,12 @@ open_config(void) } } - /* Finally, try foot/foot.ini in all XDG_CONFIG_DIRS */ + /* Finally, try foot/foot.ini in all XDG_CONFIG_DIRS, or /etc/xdg + * if unset */ const char *xdg_config_dirs = getenv("XDG_CONFIG_DIRS"); xdg_config_dirs_copy = xdg_config_dirs != NULL - ? strdup(xdg_config_dirs) : NULL; + ? strdup(xdg_config_dirs) + : strdup("/etc/xdg"); if (xdg_config_dirs_copy != NULL) { for (char *save = NULL, -- cgit v1.3