stricmp, strnicmp ---> strcasecmp, strncasecmp

This commit is contained in:
Anton E. Gavrilov 2000-06-11 03:47:11 +00:00
parent 092e377dc1
commit b9acf19025
2 changed files with 8 additions and 8 deletions

View file

@ -671,18 +671,18 @@ char *Cmd_CompleteCommand (char *partial)
// check for exact match
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
if (!stricmp (partial, cmd->name))
if (!strcasecmp (partial, cmd->name))
return cmd->name;
for (a=cmd_alias ; a ; a=a->next)
if (!stricmp (partial, a->name))
if (!strcasecmp (partial, a->name))
return a->name;
// check for partial match
for (cmd=cmd_functions ; cmd ; cmd=cmd->next)
if (!strnicmp (partial, cmd->name, len))
if (!strncasecmp (partial, cmd->name, len))
return cmd->name;
for (a=cmd_alias ; a ; a=a->next)
if (!strnicmp (partial, a->name, len))
if (!strncasecmp (partial, a->name, len))
return a->name;
return NULL;

View file

@ -156,22 +156,22 @@ char *Cvar_CompleteVariable (char *partial)
// check exact match
for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
if (!stricmp (partial,cvar->name))
if (!strcasecmp (partial,cvar->name))
return cvar->name;
// check aliases too :)
for (alias=calias_vars ; alias ; alias=alias->next)
if (!stricmp (partial, alias->name))
if (!strcasecmp (partial, alias->name))
return alias->name;
// check partial match
for (cvar=cvar_vars ; cvar ; cvar=cvar->next)
if (!strnicmp (partial,cvar->name, len))
if (!strncasecmp (partial,cvar->name, len))
return cvar->name;
// check aliases too :)
for (alias=calias_vars ; alias ; alias=alias->next)
if (!strnicmp (partial, alias->name, len))
if (!strncasecmp (partial, alias->name, len))
return alias->name;
return NULL;