Check for shaders without closing brace
Shaders without closing brace can eat shaders in other files. Pass depth to SkipBracedSection instead of reparsing text as it messed up parse line numbers.
This commit is contained in:
parent
c0a21d0898
commit
3ec2b02dce
4 changed files with 41 additions and 21 deletions
|
@ -552,16 +552,14 @@ void COM_MatchToken( char **buf_p, char *match ) {
|
|||
=================
|
||||
SkipBracedSection
|
||||
|
||||
The next token should be an open brace.
|
||||
The next token should be an open brace or set depth to 1 if already parsed it.
|
||||
Skips until a matching close brace is found.
|
||||
Internal brace depths are properly skipped.
|
||||
=================
|
||||
*/
|
||||
void SkipBracedSection (char **program) {
|
||||
qboolean SkipBracedSection (char **program, int depth) {
|
||||
char *token;
|
||||
int depth;
|
||||
|
||||
depth = 0;
|
||||
do {
|
||||
token = COM_ParseExt( program, qtrue );
|
||||
if( token[1] == 0 ) {
|
||||
|
@ -573,6 +571,8 @@ void SkipBracedSection (char **program) {
|
|||
}
|
||||
}
|
||||
} while( depth && *program );
|
||||
|
||||
return ( depth == 0 );
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue