Skip to content

Commit

Permalink
Merge branch 'master' into for-0.56.0/sync
Browse files Browse the repository at this point in the history
  • Loading branch information
VReaperV committed Feb 12, 2025
2 parents 19e1249 + 55bf481 commit 4e150b0
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/engine/qcommon/q_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,26 +416,27 @@ static const char *SkipWhitespace( const char *data, bool *hasNewLines )

int COM_Compress( char *data_p )
{
char *datai, *datao;
int c, size;
char *datai, *datao;
bool ws = false;

size = 0;
int size = 0;
datai = datao = data_p;

char c;
if ( datai )
{
while ( ( c = *datai ) != 0 )
{
if ( c == 13 || c == 10 )
if ( c == '\n' || c == '\r' )
{
c = '\n'; // Change `\r` endings to `\n`
*datao = c;
datao++;
ws = false;
datai++;
size++;
// skip double slash comments
}
// skip double slash comments
else if ( c == '/' && datai[ 1 ] == '/' )
{
while ( *datai && *datai != '\n' )
Expand All @@ -444,8 +445,9 @@ int COM_Compress( char *data_p )
}

ws = false;
// skip /* */ comments

}
// skip /* */ comments
else if ( c == '/' && datai[ 1 ] == '*' )
{
datai += 2; // Arnout: skip over '/*'
Expand Down

0 comments on commit 4e150b0

Please sign in to comment.