engine/EngineConsoleCommand.c
/*	Adds command text immediately after the current command
	Adds a \n to the text
	FIXME: actually change the command buffer to do less copying
*/
Adds command text immediately after the current command
Adds a \n to the text
FIXME: actually change the command buffer to do less copying
Adds command text immediately after the current command Adds a \ n to the text FIXME : actually change the command buffer to do less copying
void Cbuf_InsertText (const char *text)
{
	char	*temp = NULL;
	int		templen;
	templen = cmd_text.cursize;
	if (templen)
	{
		temp = (char*)malloc_or_die(templen);
		memcpy(temp, cmd_text.data, templen);
		SZ_Clear (&cmd_text);
	}
	Cbuf_AddText (text);
	if (templen)
	{
		SZ_Write (&cmd_text, temp, templen);
		free(temp);
	}
}
void Cbuf_InsertText ( const char * text ) { char * temp = NULL ; int templen ; templen = cmd_text . cursize ; if ( templen ) { temp = ( char * ) malloc_or_die ( templen ) ; memcpy ( temp , cmd_text . data , templen ) ; SZ_Clear ( & cmd_text ) ; } Cbuf_AddText ( text ) ; if ( templen ) { SZ_Write ( & cmd_text , temp , templen ) ; free ( temp ) ; } }
Adds command text immediately after the current command
Adds a \n to the text
FIXME: actually change the command buffer to do less copying
Adds command text immediately after the current command Adds a \ n to the text FIXME : actually change the command buffer to do less copying
// Copy off any commands still remaining in the exec buffer // Add the entire text of the file // Add the copied off data