From: divverent Date: Sun, 1 Apr 2012 13:30:20 +0000 (+0000) Subject: slightly simplify cmd and cvar code (also silences a - false - cppcheck error) X-Git-Tag: xonotic-v0.8.0~96^2~259 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=462ee906731d1e2ee79707aaee0365ad717231ce;p=xonotic%2Fdarkplaces.git slightly simplify cmd and cvar code (also silences a - false - cppcheck error) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11779 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cmd.c b/cmd.c index beee312d..4d615f1a 100644 --- a/cmd.c +++ b/cmd.c @@ -1200,15 +1200,15 @@ static void Cmd_List_f (void) { partial = Cmd_Argv (1); len = strlen(partial); + ispattern = (strchr(partial, '*') || strchr(partial, '?')); } else { partial = NULL; len = 0; + ispattern = false; } - ispattern = partial && (strchr(partial, '*') || strchr(partial, '?')); - count = 0; for (cmd = cmd_functions; cmd; cmd = cmd->next) { diff --git a/cvar.c b/cvar.c index 4e9e20da..521e2842 100644 --- a/cvar.c +++ b/cvar.c @@ -851,15 +851,15 @@ void Cvar_List_f (void) { partial = Cmd_Argv (1); len = strlen(partial); + ispattern = (strchr(partial, '*') || strchr(partial, '?')); } else { partial = NULL; len = 0; + ispattern = false; } - ispattern = partial && (strchr(partial, '*') || strchr(partial, '?')); - count = 0; for (cvar = cvar_vars; cvar; cvar = cvar->next) {