Refactor tokenization to save raw tokens and use static buffer space...

...rather than dynamic storage.

As a side effect, this seems to have fixed a very ninor bug in the processing
of the bare word 'nothing'.  But I don't know where the bug was.  Not happy.
This commit is contained in:
Eric S. Raymond 2017-07-03 08:53:10 -04:00
parent eba8015059
commit f03bde268e
4 changed files with 14 additions and 23 deletions

7
main.c
View file

@ -1054,12 +1054,7 @@ L2600:
strncpy(inputbuf, input, LINESIZE - 1);
free(input);
long tokens[4];
tokenize(inputbuf, tokens);
command.wd1 = tokens[0];
command.wd1x = tokens[1];
command.wd2 = tokens[2];
command.wd2x = tokens[3];
tokenize(inputbuf, &command);
/* Every input, check "game.foobar" flag. If zero, nothing's
* going on. If pos, make neg. If neg, he skipped a word,