=============================================================================
*/
+ // LordHavoc: inreased this from 8192 to 32768
static sizebuf_t cmd_text;
+static qbyte cmd_text_buf[32768];
/*
============
*/
void Cbuf_Init (void)
{
- // LordHavoc: inreased this from 8192 to 32768
- SZ_Alloc (&cmd_text, 32768, "command buffer"); // space for commands and script files
+ // space for commands and script files
+ cmd_text.data = cmd_text_buf;
+ cmd_text.maxsize = sizeof(cmd_text_buf);
+ cmd_text.cursize = 0;
}
+/*
+============
+Cbuf_Shutdown
+============
+*/
+void Cbuf_Shutdown (void)
+{
+}
/*
============
Cmd_AddCommand ("seta", Cvar_SetA_f);
}
+/*
+============
+Cmd_Shutdown
+============
+*/
+void Cmd_Shutdown(void)
+{
+ Mem_FreePool(&cmd_mempool);
+}
+
/*
============
Cmd_Argc
while (1)
{
// skip whitespace up to a /n
- while (*text && *text <= ' ' && *text != '\n')
+ while (*text && *text <= ' ' && *text != '\r' && *text != '\n')
text++;
- if (*text == '\n')
+ // line endings:
+ // UNIX: \n
+ // Mac: \r
+ // Windows: \r\n
+ if (*text == '\n' || *text == '\r')
{
// a newline seperates commands in the buffer
+ if (*text == '\r' && text[1] == '\n')
+ text++;
text++;
break;
}