(svn r1883) -Fix: [1109400] Better test if a string actually contains any console command
--- a/console.c Thu Feb 17 15:53:47 2005 +0000
+++ b/console.c Thu Feb 17 17:38:17 2005 +0000
@@ -1094,8 +1094,16 @@
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);
--- a/console_cmds.c Thu Feb 17 15:53:47 2005 +0000
+++ b/console_cmds.c Thu Feb 17 17:38:17 2005 +0000
@@ -611,9 +611,7 @@
fgets(cmd, sizeof(cmd), _script_file);
while (!feof(_script_file) && _script_running) {
- strtok(cmd, "\r\n#");
- if (strlen(cmd) > 0 && cmd[0] != '#')
- IConsoleCmdExec(cmd);
+ IConsoleCmdExec(cmd);
fgets(cmd, sizeof(cmd), _script_file);
}