Catch more bad shader syntax cases

Use to only ignore file in cases where both { and \0 were missing after shader name. Now ignore file when either are missing, such as "}\0".
This commit is contained in:
Zack Middleton 2013-05-30 22:58:58 -05:00
parent 120e296a74
commit eb73dcb7f4
2 changed files with 2 additions and 2 deletions

View File

@ -2955,7 +2955,7 @@ static void ScanAndLoadShaderFiles( void )
oldp = p;
token = COM_ParseExt(&p, qtrue);
if(token[0] != '{' && token[1] != '\0')
if(token[0] != '{' || token[1] != '\0')
{
ri.Printf(PRINT_WARNING, "WARNING: Bad shader file %s has incorrect syntax.\n", filename);
ri.FS_FreeFile(buffers[i]);

View File

@ -3595,7 +3595,7 @@ static void ScanAndLoadShaderFiles( void )
oldp = p;
token = COM_ParseExt(&p, qtrue);
if(token[0] != '{' && token[1] != '\0')
if(token[0] != '{' || token[1] != '\0')
{
ri.Printf(PRINT_WARNING, "WARNING: Bad shader file %s has incorrect syntax.\n", filename);
ri.FS_FreeFile(buffers[i]);