try $XDG_DATA_HOME before $HOME for REPL history directory

This commit is contained in:
dzaima 2022-11-06 00:39:11 +02:00
parent ff36205a34
commit 35abd7f7e8

View File

@ -743,7 +743,8 @@ int main(int argc, char* argv[]) {
cbqn_init_replxx();
Replxx* replxx = replxx_init();
char* history_dir = getenv("HOME");
char* history_dir = getenv("XDG_DATA_HOME");
if (!history_dir) history_dir = getenv("HOME");
if (!history_dir) history_dir = ".";
B p1 = utf8Decode0(history_dir);
B p2 = path_rel(p1, m_c8vec_0(".cbqn_repl_history"));