main: get_config_path: look in XDG_CONFIG_HOME first

This commit is contained in:
Daniel Eklöf 2019-04-29 18:53:03 +02:00
parent 750615b35f
commit 63f7f6b3d8

5
main.c
View file

@ -66,12 +66,13 @@ get_config_path(void)
{
struct stat st;
char *config = get_config_path_user_config();
char *config = get_config_path_xdg();
if (config != NULL && stat(config, &st) == 0 && S_ISREG(st.st_mode))
return config;
free(config);
config = get_config_path_xdg();
/* 'Default' XDG_CONFIG_HOME */
config = get_config_path_user_config();
if (config != NULL && stat(config, &st) == 0 && S_ISREG(st.st_mode))
return config;
free(config);