There was an error while loading. Please reload this page.
1 parent 38dbcde commit 699e544Copy full SHA for 699e544
src/os/core/linux/os_core_linux.c
@@ -1573,8 +1573,17 @@ main(int argc, char **argv)
1573
1574
// rjf: grab home directory
1575
{
1576
- char *home = getenv("HOME");
1577
- info->user_program_data_path = str8_cstring(home);
+ char *data_home = getenv("XDG_CONFIG_HOME");
+ if (data_home == 0 ||
1578
+ cstring8_length((U8 *)data_home) == 0) {
1579
+ // default to $HOME/.config
1580
+ data_home = getenv("HOME");
1581
+ info->user_program_data_path = push_str8f(os_lnx_state.arena, "%S/%S",
1582
+ str8_cstring(data_home),
1583
+ str8_lit(".config"));
1584
+ } else {
1585
+ info->user_program_data_path = str8_cstring(data_home);
1586
+ }
1587
}
1588
1589
scratch_end(scratch);
0 commit comments