aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-02-16 22:57:45 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-02-16 22:57:45 +0000
commitf209c48da0c8cf2a3989ddd786013c0aab74a97b (patch)
tree274001ca31e6a38cb236966e1b2ac0b642a56335 /code
parent0be1f6dfd16bf9fd12775fa0638c36ccb8cca9bc (diff)
downloadioquake3-aero-f209c48da0c8cf2a3989ddd786013c0aab74a97b.tar.gz
ioquake3-aero-f209c48da0c8cf2a3989ddd786013c0aab74a97b.zip
Fall back to libcurl.so.4 or libcurl.so.4 if the default symlink does not exist.
git-svn-id: svn://svn.icculus.org/quake3/trunk@1266 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code')
-rw-r--r--code/client/cl_curl.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/code/client/cl_curl.c b/code/client/cl_curl.c
index e4db3eb..216d9cc 100644
--- a/code/client/cl_curl.c
+++ b/code/client/cl_curl.c
@@ -100,13 +100,28 @@ qboolean CL_cURL_Init()
return qfalse;
#else
char fn[1024];
- 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 )
+ // 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);
+
+ if((cURLLib = Sys_LoadLibrary(fn)) == 0)
{
- return qfalse;
+ Q_strncpyz(fn, cl_cURLLib->string, sizeof(fn));
+ strncat(fn, ".3", sizeof(fn)-strlen(fn)-1);
+
+ if((cURLLib = Sys_LoadLibrary(fn)) == 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;
+ }
+ }
}
#endif /* _WIN32 */
}