#define MAX_ALIAS_NAME 32
// this is the largest script file that can be executed in one step
// LordHavoc: inreased this from 8192 to 32768
-#define CMDBUFSIZE 32768
+// div0: increased this from 32k to 128k
+#define CMDBUFSIZE 131072
// maximum number of parameters to a command
#define MAX_ARGS 80
// maximum tokenizable commandline length (counting NUL terminations)
-#define CMD_TOKENIZELENGTH (MAX_INPUTLINE + 80)
+#define CMD_TOKENIZELENGTH (MAX_INPUTLINE + MAX_ARGS)
typedef struct cmdalias_s
{
break;
}
+ /* should never happen
+ if(i >= MAX_INPUTLINE)
+ i = MAX_INPUTLINE - 1;
+ */
+
memcpy (line, text, i);
line[i] = 0;
{
i++;
cmd_text.cursize -= i;
- memcpy (cmd_text.data, text+i, cmd_text.cursize);
+ memmove (cmd_text.data, text+i, cmd_text.cursize);
}
// execute the command line
Con_Printf("couldn't exec %s\n",Cmd_Argv(1));
return;
}
- Con_DPrintf("execing %s\n",Cmd_Argv(1));
+ Con_Printf("execing %s\n",Cmd_Argv(1));
// if executing default.cfg for the first time, lock the cvar defaults
// it may seem backwards to insert this text BEFORE the default.cfg
}
else
{ // Invalid CVar
- Con_Printf("ERROR : CVar '%s' not found\n", Cmd_Argv(2) );
+ Con_Printf("ERROR : CVar '%s' not found\n", Cmd_Argv(1) );
}
}
}
*/
static void Cmd_ExecuteAlias (cmdalias_t *alias)
{
- static char buffer[ MAX_INPUTLINE + 2 ];
- static char buffer2[ MAX_INPUTLINE * 2 + 2 ];
+ static char buffer[ MAX_INPUTLINE ];
+ static char buffer2[ MAX_INPUTLINE ];
Cmd_PreprocessString( alias->value, buffer, sizeof(buffer) - 2, alias );
// insert at start of command buffer, so that aliases execute in order
// (fixes bug introduced by Black on 20050705)
-
+
// Note: Cbuf_PreprocessString will be called on this string AGAIN! So we
// have to make sure that no second variable expansion takes place, otherwise
// alias parameters containing dollar signs can have bad effects.