diff options
author | Ian Fan <ianfan0@gmail.com> | 2018-12-03 10:53:54 +0000 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-12-03 12:12:21 +0100 |
commit | de66ed4beb6f8091ddfb3615d79c682a7cd7f508 (patch) | |
tree | 69cc5d553bf1e712ee58118ee93a212d57348588 | |
parent | 9b41db32ec1eda4f67267346a8535c9c30e1cabb (diff) | |
download | sway-de66ed4beb6f8091ddfb3615d79c682a7cd7f508.tar.xz |
config: set $XDG_CONFIG_HOME if empty
Before, it was only set if it was not set, but it should also be done
when empty.
-rw-r--r-- | sway/config.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sway/config.c b/sway/config.c index 46322374..8bc65857 100644 --- a/sway/config.c +++ b/sway/config.c @@ -316,7 +316,8 @@ static char *get_config_path(void) { SYSCONFDIR "/i3/config", }; - if (!getenv("XDG_CONFIG_HOME")) { + char *curr_config_home = getenv("XDG_CONFIG_HOME"); + if (!curr_config_home || !*curr_config_home) { char *home = getenv("HOME"); char *config_home = malloc(strlen(home) + strlen("/.config") + 1); if (!config_home) { |