From df49d3b4d2085632b225d710b17e4f29e99435cb Mon Sep 17 00:00:00 2001 From: Timothee 'TTimo' Besset Date: Sun, 23 Apr 2023 22:50:22 -0500 Subject: [PATCH] fix release crash --- radiant/main.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/radiant/main.cpp b/radiant/main.cpp index 77be132f..87b5d12e 100644 --- a/radiant/main.cpp +++ b/radiant/main.cpp @@ -186,13 +186,13 @@ int loki_getmountpoint( const char *device, char *mntpt, int max_size ){ This function gets the directory containing the running program. argv0 - the 0'th argument to the program */ -char* loki_init_datapath( char *argv0 ){ +void loki_init_datapath( char *argv0 ){ char temppath[PATH_MAX]; - char *home; + const char *home; home = g_get_home_dir(); if ( home == NULL ) { - home = const_cast("."); + home = "."; } strcpy( temppath, argv0 ); @@ -204,10 +204,6 @@ char* loki_init_datapath( char *argv0 ){ } } -char *loki_get_datapath( void ){ - return datapath; -} - #endif // end of Loki stuff @@ -513,7 +509,7 @@ int mainRadiant( int argc, char* argv[] ) { AddSlash( g_strTempPath ); loki_init_datapath( argv[0] ); - g_strAppPath = loki_get_datapath(); + g_strAppPath = datapath; const char *xdg_data_home = getenv( "XDG_DATA_HOME" ); if ( xdg_data_home != nullptr ) {