Skip to content

Commit e4ba442

Browse files
author
falkTX
committed
On linux, save config file in HOME dir
1 parent 9fd245f commit e4ba442

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/files/config.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ void SaveConfig(void)
6767
sprintf(extension, "PROTCFGF");
6868
Status_Box("Saving 'ptk.cfg'...");
6969

70+
#ifdef __linux__
71+
sprintf(FileName, "%s/.ptk.cfg", getenv("HOME"));
72+
#else
7073
sprintf(FileName, "%s"SLASH"ptk.cfg", ExePath);
74+
#endif
7175

7276
memset(KeyboardName, 0, sizeof(KeyboardName));
7377
sprintf(KeyboardName, "%s", Keyboard_Name);
@@ -170,7 +174,11 @@ void LoadConfig(void)
170174
char Win_Coords[64];
171175
SDL_Surface *Desktop = NULL;
172176

177+
#ifdef __linux__
178+
sprintf(FileName, "%s/.ptk.cfg", getenv("HOME"));
179+
#else
173180
sprintf(FileName, "%s"SLASH"ptk.cfg", ExePath);
181+
#endif
174182

175183
memset(KeyboardName, 0, sizeof(KeyboardName));
176184

0 commit comments

Comments
 (0)