aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2022-04-06 16:44:09 +0000
committerDaniel Eklöf <daniel@ekloef.se>2022-04-07 11:06:01 +0000
commit20608c987b1668cb2b4e3cff7615577cd05c2075 (patch)
tree85ed96cc6fb17c321b67aa7a16aa04cf986b1c82 /config.c
parentconfig: add tweak option to allow disabling sixels (diff)
config: fallback to /etc/xdg if XDG_CONFIG_DIRS is unset
Closes #1008
Diffstat (limited to 'config.c')
-rw-r--r--config.c6
1 files changed, 4 insertions, 2 deletions
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,