freebsd-ports/games/quake2lnx/files/patch-src_linux_vid_so.c
Alexey Dokuchaev 29a8fa28da Further work on my beloved port:
- Rework the way we handle BASEDIR/LIBDIR, keeping ability to set basedir
  from command line.  Only ref_*.so files path left hardcoded
- Tiny fix for dedicated server build (Makefile typo)
- Most importantly, help Quake II always find libGL.so (no more LD_PRELOAD
  magic).  Bump PORTREVISION for that [*]
- Restore my nifty comments in pkg-plist

References:	http://utah-glx.sourceforge.net/faq.html#AEN262 [*]
2006-03-21 16:24:32 +00:00

34 lines
924 B
C

--- 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;