mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 15:31:39 +00:00
cmd.c: Fix the unalias command.
git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@344 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
c14af608a9
commit
445ecebee4
1 changed files with 8 additions and 3 deletions
11
Quake/cmd.c
11
Quake/cmd.c
|
@ -376,18 +376,23 @@ void Cmd_Unalias_f (void)
|
|||
Con_Printf("unalias <name> : delete alias\n");
|
||||
break;
|
||||
case 2:
|
||||
for (prev = a = cmd_alias; a; a = a->next)
|
||||
prev = NULL;
|
||||
for (a = cmd_alias; a; a = a->next)
|
||||
{
|
||||
if (!strcmp(Cmd_Argv(1), a->name))
|
||||
{
|
||||
prev->next = a->next;
|
||||
if (prev)
|
||||
prev->next = a->next;
|
||||
else
|
||||
cmd_alias = a->next;
|
||||
|
||||
Z_Free (a->value);
|
||||
Z_Free (a);
|
||||
prev = a;
|
||||
return;
|
||||
}
|
||||
prev = a;
|
||||
}
|
||||
Con_Printf ("No alias named %s\n", Cmd_Argv(1));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue