Fix bug in handling CRLF line endings in ShaderLibrary
authorPyry Haulos <phaulos@google.com>
Tue, 2 Dec 2014 23:29:08 +0000 (15:29 -0800)
committerPyry Haulos <phaulos@google.com>
Tue, 2 Dec 2014 23:29:08 +0000 (15:29 -0800)
glsShaderLibrary.cpp failed to strip first empty line from shader strings
if .test file was using CRLF line endings. That was leading to further
issues later on.

Bug: 18595005
Change-Id: Ia783c2bed4c838877c80f7c51bcf3fb021b75c8f

modules/glshared/glsShaderLibrary.cpp

index 386b16f..3d4d976 100644 (file)
@@ -319,6 +319,7 @@ string ShaderParser::parseShaderSource (const char* str)
 
        // Eat first empty line from beginning.
        while (*p == ' ') p++;
+       if (*p == '\r') p++;
        if (*p == '\n') p++;
 
        while ((p[0] != '"') || (p[1] != '"'))