aboutsummaryrefslogtreecommitdiff
path: root/games/quake2lnx/files/patch-src_linux_vid_so.c
blob: 9c8e80cba5d49a8bc9a7c46a4da5ac6bcf707cce (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
--- src/linux/vid_so.c.orig	Tue Mar 21 19:43:33 2006
+++ src/linux/vid_so.c	Tue Mar 21 19:47:12 2006
@@ -216,7 +216,6 @@
 	refimport_t	ri;
 	GetRefAPI_t	GetRefAPI;
 	char	fn[MAX_OSPATH];
-	char	*path;
 	struct stat st;
 	extern uid_t saved_euid;
 	
@@ -237,9 +236,7 @@
 	//regain root
 	seteuid(saved_euid);
 
-	path = Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
-
-	snprintf (fn, MAX_OSPATH, "%s/%s", path, name );
+	snprintf (fn, MAX_OSPATH, "%%LIBDIR%%/%s", name );
 	
 	if (stat(fn, &st) == -1) {
 		Com_Printf( "LoadLibrary(\"%s\") failed: %s\n", name, strerror(errno));
@@ -490,11 +487,9 @@
 qboolean VID_CheckRefExists (const char *ref)
 {
 	char	fn[MAX_OSPATH];
-	char	*path;
 	struct stat st;
 
-	path = Cvar_Get ("basedir", ".", CVAR_NOSET)->string;
-	snprintf (fn, MAX_OSPATH, "%s/ref_%s.so", path, ref );
+	snprintf (fn, MAX_OSPATH, "%%LIBDIR%%/ref_%s.so", ref );
 	
 	if (stat(fn, &st) == 0)
 		return true;