summaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2013-09-04 17:55:54 +0100
committerTim Angus <tim@ngus.net>2014-06-17 17:43:34 +0100
commitcc05b29d64d1452085daa74f47c49675ffb89e54 (patch)
tree9755102131618ca76781a8e564fa52d894c9e018 /src/sys
parent3d8308e447530c745542ffbf963ab9e53792ac4c (diff)
Bug #6021 Fix misuse of Sys_Mkdir (Joerg Dietrich)
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/sys_unix.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/sys/sys_unix.c b/src/sys/sys_unix.c
index 10a71b43..31c53b88 100644
--- a/src/sys/sys_unix.c
+++ b/src/sys/sys_unix.c
@@ -506,6 +506,7 @@ void Sys_ErrorDialog( const char *error )
const char *homepath = Cvar_VariableString( "fs_homepath" );
const char *gamedir = Cvar_VariableString( "fs_game" );
const char *fileName = "crashlog.txt";
+ char *dirpath = FS_BuildOSPath( homepath, gamedir, "");
char *ospath = FS_BuildOSPath( homepath, gamedir, fileName );
Sys_Print( va( "%s\n", error ) );
@@ -515,9 +516,16 @@ void Sys_ErrorDialog( const char *error )
#endif
// Make sure the write path for the crashlog exists...
- if(!Sys_Mkdir(ospath))
+
+ if(!Sys_Mkdir(homepath))
+ {
+ Com_Printf("ERROR: couldn't create path '%s' for crash log.\n", homepath);
+ return;
+ }
+
+ if(!Sys_Mkdir(dirpath))
{
- Com_Printf("ERROR: couldn't create path '%s' for crash log.\n", ospath);
+ Com_Printf("ERROR: couldn't create path '%s' for crash log.\n", dirpath);
return;
}