]> git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
fix crash in Cvar_CompleteCvarPrint
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 1 Feb 2006 15:51:37 +0000 (15:51 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 1 Feb 2006 15:51:37 +0000 (15:51 +0000)
added description printing to cvarlist

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5935 d7cf8633-e32d-0410-b094-e92efae38249

cvar.c

diff --git a/cvar.c b/cvar.c
index 4c91a49235545f8a1adbe62f47b26d2c35ddde8d..990ebdb8a082a6bf97c86042d309df83aacc9765 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -199,7 +199,7 @@ void Cvar_CompleteCvarPrint (const char *partial)
        // Loop through the command list and print all matches
        for (cvar = cvar_vars; cvar; cvar = cvar->next)
                if (!strncasecmp(partial, cvar->name, len))
-                       Con_Printf("%s : %s (%s) : %s\n", cvar->name, cvar->value, cvar->defstring, cvar->description);
+                       Con_Printf("%s : \"%s\" (\"%s\") : %s\n", cvar->name, cvar->string, cvar->defstring, cvar->description);
 }
 
 
@@ -421,6 +421,7 @@ cvar_t *Cvar_Get (const char *name, const char *value, int flags)
        strcpy(cvar->defstring, value);
        cvar->value = atof (cvar->string);
        cvar->integer = (int) cvar->value;
+       cvar->description = "custom cvar";
 
 // link the variable in
        cvar->next = cvar_vars;
@@ -513,7 +514,7 @@ void Cvar_List_f (void)
                if (partial && strncasecmp (partial,cvar->name,len))
                        continue;
 
-               Con_Printf("%s is \"%s\" [\"%s\"]\n", cvar->name, cvar->string, cvar->defstring);
+               Con_Printf("%s is \"%s\" [\"%s\"] %s\n", cvar->name, cvar->string, cvar->defstring, cvar->description);
                count++;
        }