Keep searching in $HOME

This commit is contained in:
Guido Cella
2020-05-10 12:48:32 +02:00
parent 3413d847c5
commit 2fd47ba0d0
2 changed files with 17 additions and 6 deletions

View File

@@ -68,8 +68,12 @@ std::string get_hist_file_path()
if (hist_file_str != nullptr)
return std::string(hist_file_str);
else
return std::string(g_get_user_data_dir()) + G_DIR_SEPARATOR + "sdcv_history";
const std::string hist_file_path = std::string(g_get_home_dir()) + G_DIR_SEPARATOR + ".sdcv_history";
if (g_file_test(hist_file_path.c_str(), G_FILE_TEST_IS_REGULAR))
return hist_file_path;
return std::string(g_get_user_data_dir()) + G_DIR_SEPARATOR + "sdcv_history";
}
class real_readline : public IReadLine