mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-03-23 11:22:05 +00:00
Make map name autocompletion case insensitive.
Compare case insensitve and copy the case insensitive partial matches into the console. But copy the case sensitive match as soon as there's a full match. Should work under Windows and Linux. Closes #621.
This commit is contained in:
parent
859588c30c
commit
d419e1f660
1 changed files with 5 additions and 3 deletions
|
@ -26,6 +26,8 @@
|
|||
* =======================================================================
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
|
||||
#include "header/common.h"
|
||||
|
||||
#define MAX_ALIAS_NAME 32
|
||||
|
@ -939,12 +941,12 @@ Cmd_CompleteMapCommand(char *partial)
|
|||
mapName = strtok(mapName, ".");
|
||||
|
||||
/* check for exact match */
|
||||
if (!strcmp(partial, mapName))
|
||||
if (!Q_strcasecmp(partial, mapName))
|
||||
{
|
||||
strcpy(retval, partial);
|
||||
}
|
||||
/* check for partial match */
|
||||
else if (!strncmp(partial, mapName, len))
|
||||
else if (!Q_strncasecmp(partial, mapName, len))
|
||||
{
|
||||
pmatch[nbMatches] = mapName;
|
||||
nbMatches++;
|
||||
|
@ -969,7 +971,7 @@ Cmd_CompleteMapCommand(char *partial)
|
|||
{
|
||||
for (k = 1; k < nbMatches; k++)
|
||||
{
|
||||
if (j >= strlen(pmatch[k]) || pmatch[0][j] != pmatch[k][j])
|
||||
if (j >= strlen(pmatch[k]) || tolower(pmatch[0][j]) != tolower(pmatch[k][j]))
|
||||
{
|
||||
partialFillContinue = false;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue