mirror of
https://github.com/labwc/labwc.git
synced 2026-04-12 08:21:13 -04:00
Correctly handle fallback config directories
This commit is contained in:
parent
23d2b82b74
commit
1385ce20ad
2 changed files with 6 additions and 2 deletions
|
|
@ -144,7 +144,11 @@ config_dir_n(int n)
|
|||
.len = sizeof(buf),
|
||||
.dirs = config_dirs
|
||||
};
|
||||
return find_dir(&ctx, n);
|
||||
if (n == 0) {
|
||||
return find_dir(&ctx, getenv("XDG_CONFIG_HOME") ? 0 : 1);
|
||||
} else {
|
||||
return find_dir(&ctx, getenv("XDG_CONFIG_DIRS") ? 2 : 3);
|
||||
}
|
||||
}
|
||||
|
||||
char *
|
||||
|
|
|
|||
|
|
@ -1474,7 +1474,7 @@ rcxml_read(const char *filename)
|
|||
* the first time. The specified 'filename' is only respected the first
|
||||
* time.
|
||||
*/
|
||||
for (int i = 3; i >= 0; i--) {
|
||||
for (int i = 1; i >= 0; i--) {
|
||||
line = NULL;
|
||||
len = 0;
|
||||
if (filename) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue