mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2025-02-13 15:31:28 +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
|
@ -376,18 +376,23 @@ void Cmd_Unalias_f (void)
|
||||||
Con_Printf("unalias <name> : delete alias\n");
|
Con_Printf("unalias <name> : delete alias\n");
|
||||||
break;
|
break;
|
||||||
case 2:
|
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))
|
if (!strcmp(Cmd_Argv(1), a->name))
|
||||||
{
|
{
|
||||||
|
if (prev)
|
||||||
prev->next = a->next;
|
prev->next = a->next;
|
||||||
|
else
|
||||||
|
cmd_alias = a->next;
|
||||||
|
|
||||||
Z_Free (a->value);
|
Z_Free (a->value);
|
||||||
Z_Free (a);
|
Z_Free (a);
|
||||||
prev = a;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
prev = a;
|
prev = a;
|
||||||
}
|
}
|
||||||
|
Con_Printf ("No alias named %s\n", Cmd_Argv(1));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue