diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2022-04-06 18:54:04 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2022-04-07 11:06:01 +0000 |
| commit | c7dd30742ab412fc0194eebbc5e081527772fdaf (patch) | |
| tree | 5d026402991ed32724b16e41027d4f0a93552a42 | |
| parent | config: fallback to /etc/xdg if XDG_CONFIG_DIRS is unset (diff) | |
config: use fallback when XDG_CONFIG_{HOME,DIRS} is set, but empty
| -rw-r--r-- | config.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -414,7 +414,7 @@ open_config(void) char *xdg_config_dirs_copy = NULL; /* Use XDG_CONFIG_HOME, or ~/.config */ - if (xdg_config_home != NULL) { + if (xdg_config_home != NULL && xdg_config_home[0] != '\0') { int fd = open(xdg_config_home, O_RDONLY); if (fd >= 0) path_component_add(&components, xdg_config_home, fd); @@ -447,7 +447,7 @@ open_config(void) /* 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 + xdg_config_dirs_copy = xdg_config_dirs != NULL && xdg_config_dirs[0] != '\0' ? strdup(xdg_config_dirs) : strdup("/etc/xdg"); |
