From e3c3b0539632c1d1cf0eaeaf43d2195d78f67554 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Wed, 30 Oct 2019 16:55:00 +0300 Subject: [PATCH] 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 --- engine/platform/android/lib_android.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/engine/platform/android/lib_android.c b/engine/platform/android/lib_android.c index 68a7673e..143552d7 100644 --- a/engine/platform/android/lib_android.c +++ b/engine/platform/android/lib_android.c @@ -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 )