Make sure "word" in readlevelheader gets reset

... because some things (Lua. custom header entries) move it.
https://mb.srb2.org/showthread.php?t=40580

(Technically breaks netgame compatibility for Lua-heavy mods, so in next.)
This commit is contained in:
STJrInuyasha 2015-06-13 15:56:28 -07:00
parent f7c463418e
commit 45515df790
1 changed files with 4 additions and 1 deletions

View File

@ -998,7 +998,7 @@ static const struct {
static void readlevelheader(MYFILE *f, INT32 num)
{
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
char *word = s;
char *word;
char *word2;
//char *word3; // Non-uppercase version of word2
char *tmp;
@ -1027,6 +1027,9 @@ static void readlevelheader(MYFILE *f, INT32 num)
if (s == tmp)
continue; // Skip comment lines, but don't break.
// Set / reset word, because some things (Lua.) move it
word = s;
// Get the part before the " = "
tmp = strchr(s, '=');
*(tmp-1) = '\0';