From 3d4d9b163a12b9c7b5551d6ab5f4b9c426168213 Mon Sep 17 00:00:00 2001 From: havoc Date: Wed, 1 Feb 2006 15:51:37 +0000 Subject: [PATCH] fix crash in Cvar_CompleteCvarPrint added description printing to cvarlist git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@5935 d7cf8633-e32d-0410-b094-e92efae38249 --- cvar.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cvar.c b/cvar.c index 4c91a492..990ebdb8 100644 --- 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++; } -- 2.39.2