From dc3d2457e0f46449e97fa9a676ca6b82f9d75ce3 Mon Sep 17 00:00:00 2001 From: Thilo Schulz Date: Sun, 17 Feb 2008 13:46:34 +0000 Subject: [PATCH] Angst and zinx cajoled me into removing trying to load libcurl.so again. --- code/client/cl_curl.c | 26 ++++++++++---------------- code/client/cl_curl.h | 3 ++- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/code/client/cl_curl.c b/code/client/cl_curl.c index 216d9ccd..039b8938 100644 --- a/code/client/cl_curl.c +++ b/code/client/cl_curl.c @@ -101,27 +101,21 @@ qboolean CL_cURL_Init() #else char fn[1024]; - // On some linux distributions there is no libcurl.so symlink, but only libcurl.so.4 - - Q_strncpyz(fn, cl_cURLLib->string, sizeof(fn)); - strncat(fn, ".4", sizeof(fn)-strlen(fn)-1); + Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) ); + strncat(fn, "/", sizeof(fn)-strlen(fn)-1); + strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1); if((cURLLib = Sys_LoadLibrary(fn)) == 0) { - Q_strncpyz(fn, cl_cURLLib->string, sizeof(fn)); - strncat(fn, ".3", sizeof(fn)-strlen(fn)-1); - - if((cURLLib = Sys_LoadLibrary(fn)) == 0) +#ifdef ALTERNATE_CURL_LIB + // On some linux distributions there is no libcurl.so.3, but only libcurl.so.4. That one works too. + if( (cURLLib = Sys_LoadLibrary(ALTERNATE_CURL_LIB)) == 0 ) { - Q_strncpyz( fn, Sys_Cwd( ), sizeof( fn ) ); - strncat(fn, "/", sizeof(fn)-strlen(fn)-1); - strncat(fn, cl_cURLLib->string, sizeof(fn)-strlen(fn)-1); - - if( (cURLLib = Sys_LoadLibrary(fn)) == 0 ) - { - return qfalse; - } + return qfalse; } +#else + return qfalse; +#endif } #endif /* _WIN32 */ } diff --git a/code/client/cl_curl.h b/code/client/cl_curl.h index 196eb05c..c8d3006a 100644 --- a/code/client/cl_curl.h +++ b/code/client/cl_curl.h @@ -34,7 +34,8 @@ extern cvar_t *cl_cURLLib; #elif defined(MACOS_X) #define DEFAULT_CURL_LIB "libcurl.dylib" #else -#define DEFAULT_CURL_LIB "libcurl.so" +#define DEFAULT_CURL_LIB "libcurl.so.4" +#define ALTERNATE_CURL_LIB "libcurl.so.3" #endif #ifdef USE_LOCAL_HEADERS