aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon/cmd.c
diff options
context:
space:
mode:
authortma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-01-22 01:58:50 +0000
committertma <tma@edf5b092-35ff-0310-97b2-ce42778d08ea>2006-01-22 01:58:50 +0000
commit670a7d99911d0663c5db663ed74019dbbb12a498 (patch)
tree047307e87cea2d216b1fd0a0cad92a591a5bd1e4 /code/qcommon/cmd.c
parentb411794fc8e0dc0e2d7ec044f813cfbe42bb8865 (diff)
downloadioquake3-aero-670a7d99911d0663c5db663ed74019dbbb12a498.tar.gz
ioquake3-aero-670a7d99911d0663c5db663ed74019dbbb12a498.zip
* 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
Diffstat (limited to 'code/qcommon/cmd.c')
-rw-r--r--code/qcommon/cmd.c23
1 files changed, 20 insertions, 3 deletions
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 );
+}
/*
============