From 670a7d99911d0663c5db663ed74019dbbb12a498 Mon Sep 17 00:00:00 2001 From: tma Date: Sun, 22 Jan 2006 01:58:50 +0000 Subject: * Overhaul of console autocompletion - No longer does weird stuff like move the cursor inappropriately - Autocomplete works with compound commands - Special autocomplete on some commands e.g. \map, \demo - Removed various hacks used to counter the original autocomplete code git-svn-id: svn://svn.icculus.org/quake3/trunk@514 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/qcommon/cmd.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) (limited to 'code/qcommon/cmd.c') diff --git a/code/qcommon/cmd.c b/code/qcommon/cmd.c index b1506f5..5af0f95 100644 --- a/code/qcommon/cmd.c +++ b/code/qcommon/cmd.c @@ -439,7 +439,7 @@ will point into this temporary buffer. */ // NOTE TTimo define that to track tokenization issues //#define TKN_DBG -void Cmd_TokenizeString( const char *text_in ) { +static void Cmd_TokenizeString2( const char *text_in, qboolean ignoreQuotes ) { const char *text; char *textOut; @@ -495,7 +495,7 @@ void Cmd_TokenizeString( const char *text_in ) { // handle quoted strings // NOTE TTimo this doesn't handle \" escaping - if ( *text == '"' ) { + if ( !ignoreQuotes && *text == '"' ) { cmd_argv[cmd_argc] = textOut; cmd_argc++; text++; @@ -516,7 +516,7 @@ void Cmd_TokenizeString( const char *text_in ) { // skip until whitespace, quote, or command while ( *text > ' ' ) { - if ( text[0] == '"' ) { + if ( !ignoreQuotes && text[0] == '"' ) { break; } @@ -541,6 +541,23 @@ void Cmd_TokenizeString( const char *text_in ) { } +/* +============ +Cmd_TokenizeString +============ +*/ +void Cmd_TokenizeString( const char *text_in ) { + Cmd_TokenizeString2( text_in, qfalse ); +} + +/* +============ +Cmd_TokenizeStringIgnoreQuotes +============ +*/ +void Cmd_TokenizeStringIgnoreQuotes( const char *text_in ) { + Cmd_TokenizeString2( text_in, qtrue ); +} /* ============ -- cgit v1.2.3