From 78f51471610445d2a51b4ee9979bac82a6c0b35b Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Tue, 3 Mar 2009 17:51:37 +0000 Subject: [PATCH] =?UTF-8?q?cmd.c=20aufger=C3=A4umt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/cmd.c | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/src/common/cmd.c b/src/common/cmd.c index 97ed7013..bcef3230 100644 --- a/src/common/cmd.c +++ b/src/common/cmd.c @@ -116,7 +116,7 @@ void Cbuf_InsertText (char *text) char *temp; int templen; -// copy off any commands still remaining in the exec buffer + // copy off any commands still remaining in the exec buffer templen = cmd_text.cursize; if (templen) { @@ -127,10 +127,10 @@ void Cbuf_InsertText (char *text) else temp = NULL; // shut up compiler -// add the entire text of the file + // add the entire text of the file Cbuf_AddText (text); -// add the copied off data + // add the copied off data if (templen) { SZ_Write (&cmd_text, temp, templen); @@ -202,7 +202,7 @@ void Cbuf_Execute (void) while (cmd_text.cursize) { -// find a \n or ; line break + // find a \n or ; line break text = (char *)cmd_text.data; quotes = 0; @@ -220,9 +220,9 @@ void Cbuf_Execute (void) memcpy (line, text, i); line[i] = 0; -// delete the text from the command buffer and move remaining commands down -// this is necessary because commands (exec, alias) can insert data at the -// beginning of the text buffer + // delete the text from the command buffer and move remaining commands down + // this is necessary because commands (exec, alias) can insert data at the + // beginning of the text buffer if (i == cmd_text.cursize) cmd_text.cursize = 0; @@ -233,7 +233,7 @@ void Cbuf_Execute (void) memmove (text, text+i, cmd_text.cursize); } -// execute the command line + // execute the command line Cmd_ExecuteString (line); if (cmd_wait) @@ -301,7 +301,7 @@ qboolean Cbuf_AddLateCommands (void) int argc; qboolean ret; -// build the combined string to parse from + // build the combined string to parse from s = 0; argc = COM_Argc(); for (i=1 ; iname, s); -// copy the rest of the command line + // copy the rest of the command line cmd[0] = 0; // start out with a null string c = Cmd_Argc(); for (i=2 ; i< c ; i++) @@ -620,9 +620,9 @@ $Cvars will be expanded unless they are in a quoted token void Cmd_TokenizeString (char *text, qboolean macroExpand) { int i; - char *com_token; + const char *com_token; -// clear the args from the last string + // clear the args from the last string for (i=0 ; inext) { if (!strcmp (cmd_name, cmd->name)) @@ -780,7 +779,7 @@ char *Cmd_CompleteCommand (char *partial) if (!len) return NULL; -// check for exact match + // check for exact match for (cmd=cmd_functions ; cmd ; cmd=cmd->next) if (!strcmp (partial,cmd->name)) return cmd->name; @@ -788,7 +787,7 @@ char *Cmd_CompleteCommand (char *partial) if (!strcmp (partial, a->name)) return a->name; -// check for partial match + // check for partial match for (cmd=cmd_functions ; cmd ; cmd=cmd->next) if (!strncmp (partial,cmd->name, len)) return cmd->name; @@ -880,9 +879,9 @@ Cmd_Init */ void Cmd_Init (void) { -// -// register our commands -// + // + // register our commands + // Cmd_AddCommand ("cmdlist",Cmd_List_f); Cmd_AddCommand ("exec",Cmd_Exec_f); Cmd_AddCommand ("echo",Cmd_Echo_f);