[ioquake3] 21/25: Fix command line variables not being set correctly
Simon McVittie
smcv at debian.org
Sun Mar 12 18:23:27 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to branch debian/master
in repository ioquake3.
commit 313064baa4869888015471a6d827bb015dab9b46
Author: Zack Middleton <zack at cloemail.com>
Date: Wed Feb 22 14:40:40 2017 -0600
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 3c557d1..db9b435 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;
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ioquake3.git
More information about the Pkg-games-commits
mailing list