From: divverent Date: Thu, 16 Jul 2009 19:44:18 +0000 (+0000) Subject: some typo fixes, + unalias command X-Git-Tag: xonotic-v0.1.0preview~1568 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=14038bdf05fbf63362de75588bc248c1690553fd;p=xonotic%2Fdarkplaces.git some typo fixes, + unalias command git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9060 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/cmd.c b/cmd.c index 391b0c7b..476ec67b 100644 --- a/cmd.c +++ b/cmd.c @@ -666,6 +666,47 @@ static void Cmd_Alias_f (void) memcpy (a->value, cmd, alloclen); } +/* +=============== +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); + } +} + /* ============================================================================= @@ -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"); diff --git a/libcurl.c b/libcurl.c index f7947b37..0d3f6c7c 100644 --- 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; } diff --git a/model_shared.c b/model_shared.c index d76ac1d4..91e63ad0 100644 --- a/model_shared.c +++ b/model_shared.c @@ -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 6dc02b98..2ef95dfb 100644 --- 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 37e06f5d..688a958e 100644 --- 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; }