mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-25 23:11:20 +00:00
Detect infinite alias self-recursion mixed with other commands, such as in the case of alias a "echo test; a"; a.
(Unfortunately, this does not work if "wait" is used instead of "echo", but oh well)
(cherry picked from commit e501d9c6af)
This commit is contained in:
parent
a8529f0855
commit
49ff331ac0
1 changed files with 2 additions and 3 deletions
|
|
@ -543,10 +543,7 @@ static void COM_ExecuteString(char *ptext)
|
|||
if (!stricmp(com_argv[0], a->name))
|
||||
{
|
||||
if (recursion > MAX_ALIAS_RECURSION)
|
||||
{
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n"));
|
||||
recursion = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[1024];
|
||||
|
|
@ -578,8 +575,10 @@ static void COM_ExecuteString(char *ptext)
|
|||
}
|
||||
WRITESTRING(write, read);
|
||||
|
||||
// Monster Iestyn: keep track of how many levels of recursion we're in
|
||||
recursion++;
|
||||
COM_BufInsertText(buf);
|
||||
recursion--;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue