shithub: choc

Download patch

ref: 200b46f29ac8e00f909ecb381907c290b165b97e
parent: ed880ffdea8f9d69b2b3711785ed8cb4ac8fbec2
author: Simon Howard <[email protected]>
date: Wed Jan 7 17:05:13 EST 2009

Create the ~/.chocolate-doom/savegames directory on startup if it does
not exist.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1426

--- a/src/d_iwad.c
+++ b/src/d_iwad.c
@@ -697,8 +697,13 @@
         }
 
         savegamedir = Z_Malloc(strlen(configdir) + 30, PU_STATIC, 0);
-        sprintf(savegamedir, "%ssavegames%c%s%c", configdir,
-                             DIR_SEPARATOR, iwad_name, DIR_SEPARATOR);
+        sprintf(savegamedir, "%ssavegames%c", configdir,
+                             DIR_SEPARATOR);
+
+        M_MakeDirectory(savegamedir);
+
+        sprintf(savegamedir + strlen(savegamedir), "%s%c",
+                iwad_name, DIR_SEPARATOR);
 
         M_MakeDirectory(savegamedir);
     }