From 200b46f29ac8e00f909ecb381907c290b165b97e Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Wed, 7 Jan 2009 22:05:13 +0000 Subject: Create the ~/.chocolate-doom/savegames directory on startup if it does not exist. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1426 --- src/d_iwad.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/d_iwad.c b/src/d_iwad.c index 032679e6..4fcaafcb 100644 --- a/src/d_iwad.c +++ b/src/d_iwad.c @@ -697,8 +697,13 @@ void D_SetSaveGameDir(void) } 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); } -- cgit v1.2.3