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:
sezero 2010-10-24 14:15:27 +00:00
parent c14af608a9
commit 445ecebee4

View file

@ -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;
}
}