File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -1573,8 +1573,17 @@ main(int argc, char **argv)
15731573
15741574 // rjf: grab home directory
15751575 {
1576- char * home = getenv ("HOME" );
1577- info -> user_program_data_path = str8_cstring (home );
1576+ char * data_home = getenv ("XDG_DATA_HOME" );
1577+ if (data_home == 0 ||
1578+ cstring8_length ((U8 * )data_home ) == 0 ) {
1579+ // default to $HOME/.local/share (https://specifications.freedesktop.org/basedir/latest/#variables)
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 (".local/share" ));
1584+ } else {
1585+ info -> user_program_data_path = str8_cstring (data_home );
1586+ }
15781587 }
15791588
15801589 scratch_end (scratch );
You can’t perform that action at this time.
0 commit comments