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 committed 2013-05-30 22:58:58 -05:00
1 parent 120e296a74
commit eb73dcb7f4
2 files changed
+2 -2

No files matched your search

+1 -1
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]);
+1 -1
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]);