From cc884b7b75c9ff4c81e285995af579704329cf2b Mon Sep 17 00:00:00 2001 From: Tim Angus Date: Fri, 17 Oct 2025 17:54:58 +0100 Subject: [PATCH] Use FS_CreatePath in Sys_ErrorDialog --- code/sys/sys_unix.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/code/sys/sys_unix.c b/code/sys/sys_unix.c index a7b54e44..be054e37 100644 --- a/code/sys/sys_unix.c +++ b/code/sys/sys_unix.c @@ -671,7 +671,6 @@ 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 ) ); @@ -681,16 +680,9 @@ void Sys_ErrorDialog( const char *error ) #endif // Make sure the write path for the crashlog exists... - - if(!Sys_Mkdir(homepath)) + if( FS_CreatePath( ospath ) ) { - 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", dirpath); + Com_Printf("ERROR: couldn't create path '%s' for crash log.\n", ospath); return; }