engine: client: console: fix printing multiline messages with CRLF, like HTTP headers
This commit is contained in:
parent
639eaa9416
commit
562b54839c
1 changed files with 8 additions and 5 deletions
|
@ -875,7 +875,6 @@ void Con_Print( const char *txt )
|
||||||
Con_DeleteLastLine();
|
Con_DeleteLastLine();
|
||||||
cr_pending = 0;
|
cr_pending = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
c = *txt;
|
c = *txt;
|
||||||
|
|
||||||
switch( c )
|
switch( c )
|
||||||
|
@ -883,10 +882,13 @@ void Con_Print( const char *txt )
|
||||||
case '\0':
|
case '\0':
|
||||||
break;
|
break;
|
||||||
case '\r':
|
case '\r':
|
||||||
|
if( txt[1] != '\n' )
|
||||||
|
{
|
||||||
Con_AddLine( buf, bufpos, true );
|
Con_AddLine( buf, bufpos, true );
|
||||||
lastlength = CON_LINES_LAST().length;
|
lastlength = CON_LINES_LAST().length;
|
||||||
cr_pending = 1;
|
cr_pending = 1;
|
||||||
bufpos = 0;
|
bufpos = 0;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case '\n':
|
case '\n':
|
||||||
Con_AddLine( buf, bufpos, true );
|
Con_AddLine( buf, bufpos, true );
|
||||||
|
@ -894,6 +896,7 @@ void Con_Print( const char *txt )
|
||||||
bufpos = 0;
|
bufpos = 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
||||||
buf[bufpos++] = c | mask;
|
buf[bufpos++] = c | mask;
|
||||||
if(( bufpos >= sizeof( buf ) - 1 ) || bufpos >= ( con.linewidth - 1 ))
|
if(( bufpos >= sizeof( buf ) - 1 ) || bufpos >= ( con.linewidth - 1 ))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue