console.c: fix skipping of first match when tab-completing

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@758 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
Sander van Dijk 2012-10-01 03:55:45 +00:00
parent 4ba7ad73b6
commit 892aa73db0

View file

@ -1012,15 +1012,16 @@ void Con_TabComplete (void)
//find current match -- can't save a pointer because the list will be rebuilt each time
t = tablist;
match = keydown[K_SHIFT] ? t->prev->name : t->name;
do
{
if (!Q_strcmp(t->name, partial))
{
match = keydown[K_SHIFT] ? t->prev->name : t->next->name;
break;
}
t = t->next;
} while (t != tablist);
//use prev or next to find next match
match = keydown[K_SHIFT] ? t->prev->name : t->next->name;
}
Hunk_FreeToLowMark(mark); //it's okay to free it here because match is a pointer to persistent data