Skip to content

Commit

Permalink
Fix no exec config file when exceed limit text buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
s1lentq committed Jan 12, 2024
1 parent 93f5775 commit 32857e7
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions rehlds/engine/cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ void Cbuf_Execute(void)
}

// execute the command line
Cmd_ExecuteString(line, src_command);
if (len > 0)
Cmd_ExecuteString(line, src_command);

if (cmd_wait)
{
Expand Down Expand Up @@ -406,17 +407,12 @@ 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;
}

Cbuf_InsertTextLines(com_token);
if (com_token[0])
Cbuf_InsertTextLines(com_token);
}
}

Expand Down

0 comments on commit 32857e7

Please sign in to comment.