fix release crash

This commit is contained in:
Timothee 'TTimo' Besset 2023-04-23 22:50:22 -05:00
parent 8ddd383aaf
commit df49d3b4d2

View file

@ -186,13 +186,13 @@ int loki_getmountpoint( const char *device, char *mntpt, int max_size ){
This function gets the directory containing the running program. This function gets the directory containing the running program.
argv0 - the 0'th argument to the 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 temppath[PATH_MAX];
char *home; const char *home;
home = g_get_home_dir(); home = g_get_home_dir();
if ( home == NULL ) { if ( home == NULL ) {
home = const_cast<char*>("."); home = ".";
} }
strcpy( temppath, argv0 ); strcpy( temppath, argv0 );
@ -204,10 +204,6 @@ char* loki_init_datapath( char *argv0 ){
} }
} }
char *loki_get_datapath( void ){
return datapath;
}
#endif #endif
// end of Loki stuff // end of Loki stuff
@ -513,7 +509,7 @@ int mainRadiant( int argc, char* argv[] ) {
AddSlash( g_strTempPath ); AddSlash( g_strTempPath );
loki_init_datapath( argv[0] ); loki_init_datapath( argv[0] );
g_strAppPath = loki_get_datapath(); g_strAppPath = datapath;
const char *xdg_data_home = getenv( "XDG_DATA_HOME" ); const char *xdg_data_home = getenv( "XDG_DATA_HOME" );
if ( xdg_data_home != nullptr ) { if ( xdg_data_home != nullptr ) {