mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: restore command escaping
This commit is contained in:
parent
1de1852409
commit
508eb7ab5f
@ -983,7 +983,7 @@ static void Cmd_ExecuteStringWithPrivilegeCheck( const char *text, qboolean isPr
|
|||||||
cmd_condlevel = 0;
|
cmd_condlevel = 0;
|
||||||
|
|
||||||
// cvar value substitution
|
// cvar value substitution
|
||||||
if( cmd_scripting && cmd_scripting->value )
|
if( CVAR_TO_BOOL( cmd_scripting ))
|
||||||
{
|
{
|
||||||
while( *text )
|
while( *text )
|
||||||
{
|
{
|
||||||
@ -1330,9 +1330,43 @@ void Cmd_Null_f( void )
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
==========
|
||||||
|
Cmd_Escape
|
||||||
|
|
||||||
|
inserts escape sequences
|
||||||
|
==========
|
||||||
|
*/
|
||||||
|
void Cmd_Escape( char *newCommand, const char *oldCommand, int len )
|
||||||
|
{
|
||||||
|
int c;
|
||||||
|
int scripting = CVAR_TO_BOOL( cmd_scripting );
|
||||||
|
|
||||||
|
while( (c = *oldCommand++) && len > 1 )
|
||||||
|
{
|
||||||
|
if( c == '"' )
|
||||||
|
{
|
||||||
|
*newCommand++ = '\\';
|
||||||
|
len--;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( scripting && c == '$')
|
||||||
|
{
|
||||||
|
*newCommand++ = '$';
|
||||||
|
len--;
|
||||||
|
}
|
||||||
|
|
||||||
|
*newCommand++ = c; len--;
|
||||||
|
}
|
||||||
|
|
||||||
|
*newCommand++ = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
Cmd_Init
|
Cmd_Init
|
||||||
|
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
void Cmd_Init( void )
|
void Cmd_Init( void )
|
||||||
|
@ -503,6 +503,7 @@ qboolean Cmd_GetMovieList( const char *s, char *completedname, int length );
|
|||||||
void Cmd_TokenizeString( const char *text );
|
void Cmd_TokenizeString( const char *text );
|
||||||
void Cmd_ExecuteString( const char *text );
|
void Cmd_ExecuteString( const char *text );
|
||||||
void Cmd_ForwardToServer( void );
|
void Cmd_ForwardToServer( void );
|
||||||
|
void Cmd_Escape( char *newCommand, const char *oldCommand, int len );
|
||||||
|
|
||||||
//
|
//
|
||||||
// zone.c
|
// zone.c
|
||||||
|
Loading…
x
Reference in New Issue
Block a user