From: havoc Date: Wed, 4 Jul 2007 22:26:11 +0000 (+0000) Subject: fix $cvar expansion to work in quotes X-Git-Tag: xonotic-v0.1.0preview~2998 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=619046da73eaa7d3730f9ec099008dc6be324d72;p=xonotic%2Fdarkplaces.git fix $cvar expansion to work in quotes git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7466 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cmd.c b/cmd.c index 00aa78ba..361463cf 100644 --- a/cmd.c +++ b/cmd.c @@ -511,7 +511,6 @@ Preprocesses strings and replaces $*, $param#, $cvar accordingly static void Cmd_PreprocessString( const char *intext, char *outtext, unsigned maxoutlen, cmdalias_t *alias ) { const char *in; unsigned outlen; - int inquote; // don't crash if there's no room in the outtext buffer if( maxoutlen == 0 ) { @@ -521,10 +520,9 @@ static void Cmd_PreprocessString( const char *intext, char *outtext, unsigned ma in = intext; outlen = 0; - inquote = 0; while( *in && outlen < maxoutlen ) { - if( *in == '$' && !inquote ) { + if( *in == '$' ) { // this is some kind of expansion, see what comes after the $ in++; // replacements that can always be used: @@ -586,9 +584,6 @@ static void Cmd_PreprocessString( const char *intext, char *outtext, unsigned ma } } } else { - if( *in == '"' ) { - inquote ^= 1; - } outtext[outlen++] = *in++; } }