Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 147227 Details for
Bug 213966
games-fps/nprquake-sdl tries to write config/screenshots/savegames in GAMES_DATADIR
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
nprquake-sdl-homedir-test.patch
nprquake-sdl-homedir-test.patch (text/plain), 8.45 KB, created by
Piotr Szymaniak
on 2008-03-25 08:16:35 UTC
(
hide
)
Description:
nprquake-sdl-homedir-test.patch
Filename:
MIME Type:
Creator:
Piotr Szymaniak
Created:
2008-03-25 08:16:35 UTC
Size:
8.45 KB
patch
obsolete
>diff -Naur NPRQuake.old/Makefile NPRQuake/Makefile >--- NPRQuake.old/Makefile 2003-05-31 04:55:14.000000000 +0200 >+++ NPRQuake/Makefile 2008-03-25 01:22:16.000000000 +0100 >@@ -1,10 +1,10 @@ >-RELEASE_CFLAGS=-Dstricmp=strcasecmp -O3 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations >+RELEASE_CFLAGS=-Dstricmp=strcasecmp $(OPTFLAGS) -DGENTOO_LIBDIR='\"$(GENTOO_LIBDIR)\"' -DGENTOO_DATADIR='\"$(GENTOO_DATADIR)\"' > > DEBUG_CFLAGS=-Dstricmp=strcasecmp -g > > CFLAGS=$(RELEASE_CFLAGS) > >-DR_FLAGS=-DGLQUAKE -D_DLL_BUILD -shared >+DR_FLAGS=-DGLQUAKE -D_DLL_BUILD -shared -fPIC > > renderers=build/dr_default.so build/brush.so build/bprint.so build/sketch.so > >diff -Naur NPRQuake.old/NPRQuakeSrc/common.c NPRQuake/NPRQuakeSrc/common.c >--- NPRQuake.old/NPRQuakeSrc/common.c 1999-12-21 21:53:24.000000000 +0100 >+++ NPRQuake/NPRQuakeSrc/common.c 2008-03-25 09:08:57.000000000 +0100 >@@ -1239,6 +1239,7 @@ > > char com_cachedir[MAX_OSPATH]; > char com_gamedir[MAX_OSPATH]; >+char com_basedir[MAX_OSPATH]; > > typedef struct searchpath_s > { >@@ -1686,20 +1687,26 @@ > then loads and adds pak1.pak pak2.pak ... > ================ > */ >-void COM_AddGameDirectory (char *dir) >+static void >+COM_AddGameDirectory (char *base, char *dir) > { > int i; > searchpath_t *search; > pack_t *pak; > char pakfile[MAX_OSPATH]; > >- strcpy (com_gamedir, dir); >+ if (!base) >+ return; >+ >+ strcpy(com_gamedir, va("%s/%s", base, dir)); >+ >+// strcpy (com_gamedir, dir); > > // > // add the directory to the search path > // > search = Hunk_Alloc (sizeof(searchpath_t)); >- strcpy (search->filename, dir); >+ strcpy (search->filename, com_gamedir); > search->next = com_searchpaths; > com_searchpaths = search; > >@@ -1708,7 +1715,7 @@ > // > for (i=0 ; ; i++) > { >- sprintf (pakfile, "%s/pak%i.pak", dir, i); >+ sprintf (pakfile, "%s/pak%i.pak", com_gamedir, i); > pak = COM_LoadPackFile (pakfile); > if (!pak) > break; >@@ -1731,26 +1738,29 @@ > */ > void COM_InitFilesystem (void) > { >+ char *home; > int i, j; >- char basedir[MAX_OSPATH]; >+// char basedir[MAX_OSPATH]; > searchpath_t *search; > >+ home = getenv("HOME"); >+ > // > // -basedir <path> > // Overrides the system supplied base directory (under GAMENAME) > // > i = COM_CheckParm ("-basedir"); > if (i && i < com_argc-1) >- strcpy (basedir, com_argv[i+1]); >+ strcpy (com_basedir, com_argv[i+1]); > else >- strcpy (basedir, host_parms.basedir); >+ strcpy (com_basedir, host_parms.basedir); > >- j = strlen (basedir); >+ j = strlen (com_basedir); > > if (j > 0) > { >- if ((basedir[j-1] == '\\') || (basedir[j-1] == '/')) >- basedir[j-1] = 0; >+ if ((com_basedir[j-1] == '\\') || (com_basedir[j-1] == '/')) >+ com_basedir[j-1] = 0; > } > > // >@@ -1774,12 +1784,20 @@ > // > // start up with GAMENAME by default (id1) > // >- COM_AddGameDirectory (va("%s/"GAMENAME, basedir) ); >- >- if (COM_CheckParm ("-rogue")) >- COM_AddGameDirectory (va("%s/rogue", basedir) ); >- if (COM_CheckParm ("-hipnotic")) >- COM_AddGameDirectory (va("%s/hipnotic", basedir) ); >+ COM_AddGameDirectory(com_basedir, GAMENAME); >+// COM_AddGameDirectory(GENTOO_DATADIR"/"GAMENAME); >+ COM_AddGameDirectory(home, ".nprquake-sdl/" GAMENAME); >+ >+ if (COM_CheckParm ("-rogue")) { >+ COM_AddGameDirectory(com_basedir, "rogue"); >+// COM_AddGameDirectory(GENTOO_DATADIR"/rogue"); >+ COM_AddGameDirectory(home, ".nprquake-sdl/rogue"); >+ } >+ if (COM_CheckParm ("-hipnotic")) { >+ COM_AddGameDirectory(com_basedir, "hipnotic"); >+// COM_AddGameDirectory(GENTOO_DATADIR"/hipnotic"); >+ COM_AddGameDirectory(home, ".nprquake-sdl/hipnotic"); >+ } > > // > // -game <gamedir> >@@ -1789,9 +1807,17 @@ > if (i && i < com_argc-1) > { > com_modified = true; >- COM_AddGameDirectory (va("%s/%s", basedir, com_argv[i+1])); >+ COM_AddGameDirectory(com_basedir, com_argv[i + 1]); >+// COM_AddGameDirectory(va(GENTOO_DATADIR"/%s", com_argv[i+1])); >+ COM_AddGameDirectory(home, va(".nprquake-sdl/%s", com_argv[i + 1])); > } > >+ /* If home is available, create the game directory */ >+ if (home) { >+ COM_CreatePath(com_gamedir); >+ Sys_mkdir(com_gamedir); >+ } >+ > // > // -path <dir or packfile> [<dir or packfile>] ... > // Fully specifies the exact serach path, overriding the generated one >diff -Naur NPRQuake.old/NPRQuakeSrc/common.h NPRQuake/NPRQuakeSrc/common.h >--- NPRQuake.old/NPRQuakeSrc/common.h 1999-12-21 21:54:20.000000000 +0100 >+++ NPRQuake/NPRQuakeSrc/common.h 2008-03-24 21:54:37.000000000 +0100 >@@ -165,6 +165,7 @@ > extern int com_filesize; > struct cache_user_s; > >+extern char com_basedir[MAX_OSPATH]; > extern char com_gamedir[MAX_OSPATH]; > > void COM_WriteFile (char *filename, void *data, int len); >diff -Naur NPRQuake.old/NPRQuakeSrc/gl_rmisc.c NPRQuake/NPRQuakeSrc/gl_rmisc.c >--- NPRQuake.old/NPRQuakeSrc/gl_rmisc.c 2003-05-31 05:26:13.000000000 +0200 >+++ NPRQuake/NPRQuakeSrc/gl_rmisc.c 2008-03-25 01:07:08.000000000 +0100 >@@ -572,8 +572,9 @@ > #ifdef _WIN32 //JG > hnewlib = LoadLibrary( lib ); > #else >- libfile = malloc(strlen(lib) + 4); >- strcpy(libfile, lib); >+ libfile = malloc(strlen(lib) + 512); >+ strcpy(libfile, GENTOO_LIBDIR); >+ strcat(libfile, lib); > strcat(libfile, ".so"); > hnewlib = dlopen( libfile, RTLD_LAZY | RTLD_GLOBAL ); > free(libfile); >diff -Naur NPRQuake.old/NPRQuakeSrc/host.c NPRQuake/NPRQuakeSrc/host.c >--- NPRQuake.old/NPRQuakeSrc/host.c 1999-12-21 21:53:24.000000000 +0100 >+++ NPRQuake/NPRQuakeSrc/host.c 2008-03-24 22:06:35.000000000 +0100 >@@ -261,6 +261,10 @@ > Key_WriteBindings (f); > Cvar_WriteVariables (f); > >+ /* Save the mlook state (rarely used as an actual key binding) */ >+ if (in_mlook.state & 1) >+ fprintf(f, "+mlook\n"); >+ > fclose (f); > } > } >diff -Naur NPRQuake.old/NPRQuakeSrc/Makefile NPRQuake/NPRQuakeSrc/Makefile >--- NPRQuake.old/NPRQuakeSrc/Makefile 2002-02-11 05:30:01.000000000 +0100 >+++ NPRQuake/NPRQuakeSrc/Makefile 2008-03-25 01:22:47.000000000 +0100 >@@ -29,7 +29,7 @@ > > CC=gcc > >-RELEASE_CFLAGS=$(BASE_CFLAGS) -O3 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations >+RELEASE_CFLAGS=$(BASE_CFLAGS) $(OPTFLAGS) -DGENTOO_LIBDIR='\"$(GENTOO_LIBDIR)\"' -DGENTOO_DATADIR='\"$(GENTOO_DATADIR)\"' > DEBUG_CFLAGS=$(BASE_CFLAGS) -g > LDFLAGS=-lm > CFLAGS=$(RELEASE_CFLAGS) >@@ -176,7 +176,7 @@ > $(DO_GL_CC) > > $(BUILDDIR)/glquake/common.o : common.c >- $(DO_GL_DEBUG_CC) >+ $(DO_GL_CC) > > $(BUILDDIR)/glquake/console.o : console.c > $(DO_GL_CC) >diff -Naur NPRQuake.old/NPRQuakeSrc/math.s NPRQuake/NPRQuakeSrc/math.s >--- NPRQuake.old/NPRQuakeSrc/math.s 1999-12-21 21:53:24.000000000 +0100 >+++ NPRQuake/NPRQuakeSrc/math.s 2008-03-24 22:50:39.000000000 +0100 >@@ -416,3 +416,6 @@ > call C(BOPS_Error) > > #endif // id386 >+#if defined(__linux__) && defined(__ELF__) >+.section .note.GNU-stack,"",%progbits >+#endif >diff -Naur NPRQuake.old/NPRQuakeSrc/snd_mixa.s NPRQuake/NPRQuakeSrc/snd_mixa.s >--- NPRQuake.old/NPRQuakeSrc/snd_mixa.s 1999-12-21 21:53:26.000000000 +0100 >+++ NPRQuake/NPRQuakeSrc/snd_mixa.s 2008-03-24 22:50:39.000000000 +0100 >@@ -216,3 +216,6 @@ > > #endif // id386 > >+#if defined(__linux__) && defined(__ELF__) >+.section .note.GNU-stack,"",%progbits >+#endif >diff -Naur NPRQuake.old/NPRQuakeSrc/sys_dosa.s NPRQuake/NPRQuakeSrc/sys_dosa.s >--- NPRQuake.old/NPRQuakeSrc/sys_dosa.s 1998-08-12 18:45:38.000000000 +0200 >+++ NPRQuake/NPRQuakeSrc/sys_dosa.s 2008-03-24 22:50:39.000000000 +0100 >@@ -93,3 +93,6 @@ > > ret > >+#if defined(__linux__) && defined(__ELF__) >+.section .note.GNU-stack,"",%progbits >+#endif >diff -Naur NPRQuake.old/NPRQuakeSrc/sys_linux.c NPRQuake/NPRQuakeSrc/sys_linux.c >--- NPRQuake.old/NPRQuakeSrc/sys_linux.c 2002-02-07 01:36:28.000000000 +0100 >+++ NPRQuake/NPRQuakeSrc/sys_linux.c 2008-03-25 09:11:00.000000000 +0100 >@@ -86,7 +86,7 @@ > void Sys_Printf (char *fmt, ...) > { > va_list argptr; >- char text[2048]; >+ char text[4096]; > unsigned char *p; > > va_start (argptr,fmt); >@@ -381,7 +381,6 @@ > if (j) > parms.memsize = (int) (Q_atof(com_argv[j+1]) * 1024 * 1024); > parms.membase = malloc (parms.memsize); >- > parms.basedir = basedir; > // caching is disabled by default, use -cachedir to enable > // parms.cachedir = cachedir; >diff -Naur NPRQuake.old/NPRQuakeSrc/worlda.s NPRQuake/NPRQuakeSrc/worlda.s >--- NPRQuake.old/NPRQuakeSrc/worlda.s 1999-12-21 21:53:26.000000000 +0100 >+++ NPRQuake/NPRQuakeSrc/worlda.s 2008-03-24 22:50:39.000000000 +0100 >@@ -142,3 +142,6 @@ > > #endif // id386 > >+#if defined(__linux__) && defined(__ELF__) >+.section .note.GNU-stack,"",%progbits >+#endif
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 213966
:
147227
|
147229
|
147303
|
147304