Fix no exec config file when exceed limit text buffer

This commit is contained in:
s1lentq 2024-01-12 22:32:15 +07:00
parent 93f5775ac2
commit 32857e7785

View File

@ -235,6 +235,7 @@ void Cbuf_Execute(void)
}
// execute the command line
if (len > 0)
Cmd_ExecuteString(line, src_command);
if (cmd_wait)
@ -406,16 +407,11 @@ void Cmd_Exec_f(void)
else
{
char *pszDataPtr = configContents;
while (true)
while (pszDataPtr && *pszDataPtr)
{
Cbuf_Execute(); // TODO: This doesn't obey the rule to first execute commands from the file, and then the others in the buffer
pszDataPtr = COM_ParseLine(pszDataPtr); // TODO: COM_ParseLine can be const char*
if (com_token[0] == 0)
{
break;
}
if (com_token[0])
Cbuf_InsertTextLines(com_token);
}
}