engine: platform: android: don't check if XASH_ENGLIBDIR and XASH_GAMELIBDIR are null. Load library by direct path if PATH_SPLITTER was found. Partially fixes #74

This commit is contained in:
Alibek Omarov 2019-10-30 16:55:00 +03:00
parent 6e637456ef
commit e3c3b05396
1 changed files with 5 additions and 2 deletions

View File

@ -24,13 +24,16 @@ void *ANDROID_LoadLibrary( const char *dllname )
char path[MAX_SYSPATH];
const char *libdir[2];
int i;
void *pHandle;
void *pHandle = NULL;
libdir[0] = getenv("XASH3D_GAMELIBDIR");
libdir[1] = getenv("XASH3D_ENGLIBDIR");
for( i = 0; i < 2; i++ )
{
if( !libdir[i] )
continue;
Q_snprintf( path, MAX_SYSPATH, "%s/lib%s"POSTFIX"."OS_LIB_EXT, libdir[i], dllname );
pHandle = dlopen( path, RTLD_LAZY );
if( pHandle )
@ -40,7 +43,7 @@ void *ANDROID_LoadLibrary( const char *dllname )
}
// HACKHACK: keep old behaviour for compability
if( Q_strstr( dllname, "." OS_LIB_EXT ))
if( Q_strstr( dllname, "." OS_LIB_EXT ) || Q_strstr( dllname, PATH_SPLITTER ))
{
pHandle = dlopen( dllname, RTLD_LAZY );
if( pHandle )