some typo fixes, + unalias command
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 16 Jul 2009 19:44:18 +0000 (19:44 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 16 Jul 2009 19:44:18 +0000 (19:44 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9060 d7cf8633-e32d-0410-b094-e92efae38249

cmd.c
libcurl.c
model_shared.c
sbar.c
zone.c

diff --git a/cmd.c b/cmd.c
index 391b0c7..476ec67 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -667,6 +667,47 @@ static void Cmd_Alias_f (void)
 }
 
 /*
+===============
+Cmd_UnAlias_f
+
+Remove existing aliases.
+===============
+*/
+static void Cmd_UnAlias_f (void)
+{
+       cmdalias_t      *a, *p;
+       int i;
+       const char *s;
+
+       if(Cmd_Argc() == 1)
+       {
+               Con_Print("unalias: Usage: unalias alias1 [alias2 ...]\n");
+               return;
+       }
+
+       for(i = 1; i < Cmd_Argc(); ++i)
+       {
+               s = Cmd_Argv(i);
+               p = NULL;
+               for(a = cmd_alias; a; p = a, a = a->next)
+               {
+                       if(!strcmp(s, a->name))
+                       {
+                               if(a == cmd_alias)
+                                       cmd_alias = a->next;
+                               if(p)
+                                       p->next = a->next;
+                               Z_Free(a->value);
+                               Z_Free(a);
+                               break;
+                       }
+               }
+               if(!a)
+                       Con_Printf("unalias: %s alias not found\n", s);
+       }
+}
+
+/*
 =============================================================================
 
                                        COMMAND EXECUTION
@@ -1141,6 +1182,7 @@ void Cmd_Init_Commands (void)
        Cmd_AddCommand ("exec",Cmd_Exec_f, "execute a script file");
        Cmd_AddCommand ("echo",Cmd_Echo_f, "print a message to the console (useful in scripts)");
        Cmd_AddCommand ("alias",Cmd_Alias_f, "create a script function (parameters are passed in as $X (being X a number), $* for all parameters, $X- for all parameters starting from $X). Without arguments show the list of all alias");
+       Cmd_AddCommand ("unalias",Cmd_UnAlias_f, "remove an alias");
        Cmd_AddCommand ("cmd", Cmd_ForwardToServer, "send a console commandline to the server (used by some mods)");
        Cmd_AddCommand ("wait", Cmd_Wait_f, "make script execution wait for next rendered frame");
        Cmd_AddCommand ("set", Cvar_Set_f, "create or change the value of a console variable");
index f7947b3..0d3f6c7 100644 (file)
--- a/libcurl.c
+++ b/libcurl.c
@@ -795,7 +795,7 @@ static qboolean Curl_Begin(const char *URL, const char *name, qboolean ispak, qb
                // URL scheme (so one can't read local files using file://)
                if(strncmp(URL, "http://", 7) && strncmp(URL, "ftp://", 6) && strncmp(URL, "https://", 8))
                {
-                       Con_Printf("Curl_Begin(\"%s\")): nasty URL scheme rejected\n", URL);
+                       Con_Printf("Curl_Begin(\"%s\"): nasty URL scheme rejected\n", URL);
                        return false;
                }
 
index d76ac1d..91e63ad 100644 (file)
@@ -425,8 +425,10 @@ dp_model_t *Mod_LoadModel(dp_model_t *mod, qboolean crash, qboolean checkdisk)
 
                buf = FS_LoadFile (va("%s.framegroups", mod->name), tempmempool, false, &filesize);
                if(buf)
+               {
                        Mod_FrameGroupify(mod, buf);
-               Mem_Free(buf);
+                       Mem_Free(buf);
+               }
 
                Mod_BuildVBOs();
        }
diff --git a/sbar.c b/sbar.c
index 6dc02b9..2ef95df 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -1138,7 +1138,7 @@ void Sbar_ShowFPS(void)
        if (showdate.integer)
                strlcpy(datestring, Sys_TimeString(showdate_format.string), sizeof(datestring));
        if (showsound.integer)
-               dpsnprintf(soundstring, sizeof(soundstring), "%4i/%4i at %3ims\n", cls.soundstats.mixedsounds, cls.soundstats.totalsounds, cls.soundstats.latency_milliseconds);
+               dpsnprintf(soundstring, sizeof(soundstring), "%4i/4%i at %3ims", cls.soundstats.mixedsounds, cls.soundstats.totalsounds, cls.soundstats.latency_milliseconds);
        if (showspeed.integer || showtopspeed.integer)
        {
                double speed, speedxy, f;
diff --git a/zone.c b/zone.c
index 37e06f5..688a958 100644 (file)
--- a/zone.c
+++ b/zone.c
@@ -249,7 +249,7 @@ void _Mem_Free(void *data, const char *filename, int fileline)
 {
        if (data == NULL)
        {
-               Con_DPrintf("Mem_Free: data == NULL (called at %s:%i)", filename, fileline);
+               Con_DPrintf("Mem_Free: data == NULL (called at %s:%i)\n", filename, fileline);
                return;
        }