summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2005-05-02 17:58:11 +0000
committerDarkvater <darkvater@openttd.org>2005-05-02 17:58:11 +0000
commit4e1fbe54b2463a6d45022722e622f792cd64f09e (patch)
treeba105b4d665f76506caec95f528e9d6c34a69b1b
parent5a692014514f3108be2aed43a611d6e5b1c3b03d (diff)
downloadopenttd-4e1fbe54b2463a6d45022722e622f792cd64f09e.tar.xz
(svn r2250) - Fix (regression): arguments with spaces in them were incorrectly parsed
-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;