From 313064baa4869888015471a6d827bb015dab9b46 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Wed, 22 Feb 2017 14:40:40 -0600 Subject: [PATCH] Fix command line variables not being set correctly +seta, +sets, and +setu were ignored because Com_AddStartupCommands thought Com_StartupVariable handled it. +set didn't allow value to be multiple tokens which due to Unix shell unintuitively removing quotes causes the variable to only be set to the first token. This could be worked around by escaping quotes ioq3ded +set g_motd \"hello world\" but it doesn't match behavior of other start up commands (which now includes seta, sets, and setu) that use all tokens. --- code/qcommon/common.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/qcommon/common.c b/code/qcommon/common.c index 3c557d15..db9b435f 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -491,9 +491,9 @@ void Com_StartupVariable( const char *match ) { if(!match || !strcmp(s, match)) { if(Cvar_Flags(s) == CVAR_NONEXISTENT) - Cvar_Get(s, Cmd_Argv(2), CVAR_USER_CREATED); + Cvar_Get(s, Cmd_ArgsFrom(2), CVAR_USER_CREATED); else - Cvar_Set2(s, Cmd_Argv(2), qfalse); + Cvar_Set2(s, Cmd_ArgsFrom(2), qfalse); } } } @@ -522,7 +522,7 @@ qboolean Com_AddStartupCommands( void ) { } // set commands already added with Com_StartupVariable - if ( !Q_stricmpn( com_consoleLines[i], "set", 3 ) ) { + if ( !Q_stricmpn( com_consoleLines[i], "set ", 4 ) ) { continue; }