aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon/cmd.c
diff options
context:
space:
mode:
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 );
+}
/*
============