diff options
Diffstat (limited to 'src/qcommon/q_shared.c')
-rw-r--r-- | src/qcommon/q_shared.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/qcommon/q_shared.c b/src/qcommon/q_shared.c index 897bdae4..9cea9bda 100644 --- a/src/qcommon/q_shared.c +++ b/src/qcommon/q_shared.c @@ -290,7 +290,7 @@ static int com_lines; void COM_BeginParseSession( const char *name ) { - com_lines = 0; + com_lines = 1; Com_sprintf(com_parsename, sizeof(com_parsename), "%s", name); } @@ -474,6 +474,10 @@ char *COM_ParseExt( char **data_p, qboolean allowLineBreaks ) data += 2; while ( *data && ( *data != '*' || data[1] != '/' ) ) { + if ( *data == '\n' ) + { + com_lines++; + } data++; } if ( *data ) @@ -500,6 +504,10 @@ char *COM_ParseExt( char **data_p, qboolean allowLineBreaks ) *data_p = ( char * ) data; return com_token; } + if ( c == '\n' ) + { + com_lines++; + } if (len < MAX_TOKEN_CHARS - 1) { com_token[len] = c; @@ -518,8 +526,6 @@ char *COM_ParseExt( char **data_p, qboolean allowLineBreaks ) } data++; c = *data; - if ( c == '\n' ) - com_lines++; } while (c>32); com_token[len] = 0; |