diff options
author | tron <tron@openttd.org> | 2005-02-17 17:38:17 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2005-02-17 17:38:17 +0000 |
commit | 513eb4d7bb16c5984aa251f9dc779e56c1318d7c (patch) | |
tree | f4390c2c8b69242cbfe5fdc42d0c527f1f8b6283 /console.c | |
parent | 56a83026425c1fb9ef202b190c299409de03c935 (diff) | |
download | openttd-513eb4d7bb16c5984aa251f9dc779e56c1318d7c.tar.xz |
(svn r1883) -Fix: [1109400] Better test if a string actually contains any console command
Diffstat (limited to 'console.c')
-rw-r--r-- | console.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -1094,8 +1094,16 @@ void IConsoleCmdExec(const char* cmdstr) uint i; uint l; - if (strlen(cmdstr) == 0) // only execute if there is something typed obviously - return; + for (; strchr("\n\r \t", *cmdstr) != NULL; ++cmdstr) { + switch (*cmdstr) { + case '\0': + case '#': + return; + + default: + break; + } + } if (_stdlib_con_developer) IConsolePrintF(_iconsole_color_debug, "CONDEBUG: execution_cmdline: %s", cmdstr); |