summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--console.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/console.c b/console.c
index 7555c9f62..9be86614e 100644
--- a/console.c
+++ b/console.c
@@ -1045,10 +1045,14 @@ void IConsoleCmdExec(const char *cmdstr)
case ' ': /* Token seperator */
if (!foundtoken) break;
- tokenstream[tstream_i] = (longtoken) ? *cmdptr : '\0';
+ if (longtoken) {
+ tokenstream[tstream_i] = *cmdptr;
+ } else {
+ tokenstream[tstream_i] = '\0';
+ foundtoken = false;
+ }
tstream_i++;
- foundtoken = false;
break;
case '"': /* Tokens enclosed in "" are one token */
longtoken = !longtoken;