From e106e801b2a900192bac8dbcc714b9f1f38bde6a Mon Sep 17 00:00:00 2001 From: divverent Date: Sun, 1 Apr 2012 13:30:20 +0000 Subject: [PATCH] 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 ::stable-branch::merge=462ee906731d1e2ee79707aaee0365ad717231ce --- cmd.c | 4 ++-- cvar.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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) { -- 2.39.2