]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
slightly simplify cmd and cvar code (also silences a - false - cppcheck error)
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Sun, 1 Apr 2012 13:30:20 +0000 (13:30 +0000)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 3 Apr 2012 17:04:01 +0000 (19:04 +0200)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11779 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=462ee906731d1e2ee79707aaee0365ad717231ce

cmd.c
cvar.c

diff --git a/cmd.c b/cmd.c
index beee312d053ec2130607c22c0e916550098b9217..4d615f1a23c9b1dcc8aed5cf04d85ef7ba077118 100644 (file)
--- 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 4e9e20dab8a2cee0e256e820fe6d784c2680d450..521e2842ab3e0e93377555c3e38c182f031ce32c 100644 (file)
--- 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)
        {