make the command/cvar searching case sensitive

This commit is contained in:
Bill Currie 2007-06-09 06:55:15 +00:00 committed by Jeff Teunissen
parent f850815b8c
commit 1a601ee0f8
2 changed files with 11 additions and 11 deletions

View file

@ -213,12 +213,12 @@ Cmd_CompleteCommand (const char *partial)
// check for exact match // check for exact match
for (cmd = cmd_functions; cmd; cmd = cmd->next) for (cmd = cmd_functions; cmd; cmd = cmd->next)
if (!strcasecmp (partial, cmd->name)) if (!strcmp (partial, cmd->name))
return cmd->name; return cmd->name;
// check for partial match // check for partial match
for (cmd = cmd_functions; cmd; cmd = cmd->next) for (cmd = cmd_functions; cmd; cmd = cmd->next)
if (!strncasecmp (partial, cmd->name, len)) if (!strncmp (partial, cmd->name, len))
return cmd->name; return cmd->name;
return NULL; return NULL;
@ -247,7 +247,7 @@ Cmd_CompleteCountPossible (const char *partial)
// Loop through the command list and count all partial matches // Loop through the command list and count all partial matches
for (cmd = cmd_functions; cmd; cmd = cmd->next) for (cmd = cmd_functions; cmd; cmd = cmd->next)
if (!strncasecmp (partial, cmd->name, len)) if (!strncmp (partial, cmd->name, len))
h++; h++;
return h; return h;
@ -277,7 +277,7 @@ Cmd_CompleteBuildList (const char *partial)
SYS_CHECKMEM (buf); SYS_CHECKMEM (buf);
// Loop through the alias list and print all matches // Loop through the alias list and print all matches
for (cmd = cmd_functions; cmd; cmd = cmd->next) for (cmd = cmd_functions; cmd; cmd = cmd->next)
if (!strncasecmp (partial, cmd->name, len)) if (!strncmp (partial, cmd->name, len))
buf[bpos++] = cmd->name; buf[bpos++] = cmd->name;
buf[bpos] = NULL; buf[bpos] = NULL;
@ -463,7 +463,7 @@ Cmd_Help_f (void)
name = Cmd_Argv (1); name = Cmd_Argv (1);
for (cmd = cmd_functions; cmd && strcasecmp (name, cmd->name); for (cmd = cmd_functions; cmd && strcmp (name, cmd->name);
cmd = cmd->next); cmd = cmd->next);
if (cmd) { if (cmd) {
Sys_Printf ("%s\n", cmd->description); Sys_Printf ("%s\n", cmd->description);

View file

@ -148,22 +148,22 @@ Cvar_CompleteVariable (const char *partial)
// check exact match // check exact match
for (cvar = cvar_vars; cvar; cvar = cvar->next) for (cvar = cvar_vars; cvar; cvar = cvar->next)
if (!strcasecmp (partial, cvar->name)) if (!strcmp (partial, cvar->name))
return cvar->name; return cvar->name;
// check aliases too :) // check aliases too :)
for (alias = calias_vars; alias; alias = alias->next) for (alias = calias_vars; alias; alias = alias->next)
if (!strcasecmp (partial, alias->name)) if (!strcmp (partial, alias->name))
return alias->name; return alias->name;
// check partial match // check partial match
for (cvar = cvar_vars; cvar; cvar = cvar->next) for (cvar = cvar_vars; cvar; cvar = cvar->next)
if (!strncasecmp (partial, cvar->name, len)) if (!strncmp (partial, cvar->name, len))
return cvar->name; return cvar->name;
// check aliases too :) // check aliases too :)
for (alias = calias_vars; alias; alias = alias->next) for (alias = calias_vars; alias; alias = alias->next)
if (!strncasecmp (partial, alias->name, len)) if (!strncmp (partial, alias->name, len))
return alias->name; return alias->name;
return NULL; return NULL;
@ -191,7 +191,7 @@ Cvar_CompleteCountPossible (const char *partial)
// Loop through the cvars and count all possible matches // Loop through the cvars and count all possible matches
for (cvar = cvar_vars; cvar; cvar = cvar->next) for (cvar = cvar_vars; cvar; cvar = cvar->next)
if (!strncasecmp(partial, cvar->name, len)) if (!strncmp(partial, cvar->name, len))
h++; h++;
return h; return h;
@ -220,7 +220,7 @@ Cvar_CompleteBuildList (const char *partial)
SYS_CHECKMEM (buf); SYS_CHECKMEM (buf);
// Loop through the alias list and print all matches // Loop through the alias list and print all matches
for (cvar = cvar_vars; cvar; cvar = cvar->next) for (cvar = cvar_vars; cvar; cvar = cvar->next)
if (!strncasecmp(partial, cvar->name, len)) if (!strncmp(partial, cvar->name, len))
buf[bpos++] = cvar->name; buf[bpos++] = cvar->name;
buf[bpos] = NULL; buf[bpos] = NULL;