Skip to content

Commit 4e150b0

Browse files
committed
Merge branch 'master' into for-0.56.0/sync
2 parents 19e1249 + 55bf481 commit 4e150b0

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/engine/qcommon/q_shared.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,26 +416,27 @@ static const char *SkipWhitespace( const char *data, bool *hasNewLines )
416416

417417
int COM_Compress( char *data_p )
418418
{
419-
char *datai, *datao;
420-
int c, size;
419+
char *datai, *datao;
421420
bool ws = false;
422421

423-
size = 0;
422+
int size = 0;
424423
datai = datao = data_p;
425424

425+
char c;
426426
if ( datai )
427427
{
428428
while ( ( c = *datai ) != 0 )
429429
{
430-
if ( c == 13 || c == 10 )
430+
if ( c == '\n' || c == '\r' )
431431
{
432+
c = '\n'; // Change `\r` endings to `\n`
432433
*datao = c;
433434
datao++;
434435
ws = false;
435436
datai++;
436437
size++;
437-
// skip double slash comments
438438
}
439+
// skip double slash comments
439440
else if ( c == '/' && datai[ 1 ] == '/' )
440441
{
441442
while ( *datai && *datai != '\n' )
@@ -444,8 +445,9 @@ int COM_Compress( char *data_p )
444445
}
445446

446447
ws = false;
447-
// skip /* */ comments
448+
448449
}
450+
// skip /* */ comments
449451
else if ( c == '/' && datai[ 1 ] == '*' )
450452
{
451453
datai += 2; // Arnout: skip over '/*'

0 commit comments

Comments
 (0)