From 584dba6ae636f05babb2c1580099c71132d3bc41 Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 12 Mar 2013 23:05:17 +0000 Subject: [PATCH] ------------------------------------------------------------------------ r4223 | acceptthis | 2013-02-21 14:43:49 +0000 (Thu, 21 Feb 2013) | 1 line use multithreading in linux too, because we can. Fix extra-quotes issue. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4220 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/Makefile | 2 +- engine/client/sys_plugfte.c | 20 ++++++-------------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/engine/Makefile b/engine/Makefile index 5f767f6e4..73e4d0c7e 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -931,7 +931,7 @@ ifneq ($(shell echo $(FTE_TARGET)|grep linux),) GL_EXE_NAME=../fteqw.gl$(BITS) GLCL_EXE_NAME=../fteqwcl.gl$(BITS) GL_LDFLAGS=$(GLLDFLAGS) $(GLXLDFLAGS) $(OGGVORBISLDFLAGS) -lz - GL_CFLAGS=$(GLCFLAGS) -I/usr/X11R6/include $(SPEEXCFLAGS) -DLIBVORBISFILE_STATIC + GL_CFLAGS=$(GLCFLAGS) -I/usr/X11R6/include $(SPEEXCFLAGS) -DMULTITHREAD -DLIBVORBISFILE_STATIC GLB_DIR=gl_linux$(BITS) GLCL_DIR=glcl_linux$(BITS) diff --git a/engine/client/sys_plugfte.c b/engine/client/sys_plugfte.c index 69fce8893..c8408b5a3 100644 --- a/engine/client/sys_plugfte.c +++ b/engine/client/sys_plugfte.c @@ -880,15 +880,7 @@ char *cleanarg(char *arg) *c = '?'; } - if (*arg) - { - char *out = malloc(strlen(arg)+3); - strcpy(out+1, arg); - out[0] = '\"'; - strcat(out, "\""); - return out; - } - return strdup("\"\""); + return strdup(arg); } qboolean Plug_GetBinaryName(char *exe, int exelen, char *basedir, int basedirlen) @@ -901,9 +893,8 @@ qboolean Plug_GetBinaryName(char *exe, int exelen, char *basedir, int basedirlen *exe = 0; *basedir = 0; -//#ifdef _DEBUG // Q_strncpyz(exe, "C:/Games/Quake/fte_trunk/fteglqw_dbg.exe", exelen); -//#endif +// Q_strncpyz(exe, "/home/david/quake/fte_trunk/engine/debug/fteqw.gl", exelen); /* Q_snprintfz(buffer, sizeof(buffer), "%s%s", binarypath, "npfte.txt"); @@ -950,8 +941,9 @@ int Plug_GenCommandline(struct context *ctx, char **argv, int maxargs) return 0; //error } - argv[0] = strdup(exe); - argc = 1; + argc = 0; + + ADDRARG(exe); if (autoupdate) { @@ -1045,7 +1037,7 @@ qboolean Plug_GenCommandlineString(struct context *ctx, char *cmdline, int cmdli for (i = 0; i < argc; i++) { //add quotes for any arguments with spaces - if (strchr(argv[i], ' ')) + if (strchr(argv[i], ' ') || strchr(arg[i], '\t')) { Q_strncatz(cmdline, "\"", cmdlinelen); Q_strncatz(cmdline, argv[i], cmdlinelen);