- [CHG] Ara en Linux la configuració se guarda en " ~/.config/thepool/config.txt"

- [FIX] Solventada explosió en pantalla de gameover per un dangling pointer. Aplicades medides similars en catslife i ingame.
This commit is contained in:
2024-10-11 09:20:24 +02:00
parent 3f127b5444
commit 31f63516ca
5 changed files with 35 additions and 12 deletions

View File

@@ -341,7 +341,19 @@ namespace file
#elif __linux__
struct passwd *pw = getpwuid(getuid());
const char *homedir = pw->pw_dir;
config_folder = std::string(homedir) + "/." + foldername;
config_folder = std::string(homedir) + "/.config/" + foldername;
{
// Intenta crear ".config", per si no existeix
std::string config_base_folder = std::string(homedir) + "/.config";
int ret = mkdir(config_base_folder.c_str(), S_IRWXU);
if (ret == -1 && errno != EEXIST)
{
printf("ERROR CREATING CONFIG BASE FOLDER.");
exit(EXIT_FAILURE);
}
}
#endif
struct stat st = {0};