* Persistent console history
This commit is contained in:
parent
5a29e8df50
commit
8a6be4aef4
7 changed files with 158 additions and 6 deletions
|
@ -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 );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=====================================================================
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue