Skip to content

Commit

Permalink
Fall back to libcurl.so.4 or libcurl.so.4 if the default symlink does…
Browse files Browse the repository at this point in the history
… not exist.
  • Loading branch information
Thilo Schulz committed Feb 16, 2008
1 parent 1f86aba commit a99634c
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions code/client/cl_curl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
}
Expand Down

0 comments on commit a99634c

Please sign in to comment.