* Persistent console history

This commit is contained in:
Tim Angus 2006-01-24 04:35:19 +00:00
parent 5a29e8df50
commit 8a6be4aef4
7 changed files with 158 additions and 6 deletions

View file

@ -918,6 +918,26 @@ char * QDECL va( char *format, ... ) {
return buf;
}
/*
============
Com_TruncateLongString
Assumes buffer is atleast TRUNCATE_LENGTH big
============
*/
void Com_TruncateLongString( char *buffer, const char *s )
{
int length = strlen( s );
if( length <= TRUNCATE_LENGTH )
Q_strncpyz( buffer, s, TRUNCATE_LENGTH );
else
{
Q_strncpyz( buffer, s, ( TRUNCATE_LENGTH / 2 ) - 3 );
Q_strcat( buffer, TRUNCATE_LENGTH, " ... " );
Q_strcat( buffer, TRUNCATE_LENGTH, s + length - ( TRUNCATE_LENGTH / 2 ) + 3 );
}
}
/*
=====================================================================