Whoops, dropped last extension from the list in legacy GL extension codepath.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 10 Oct 2012 22:47:27 -0400
changeset 1118 c383aebc9f13
parent 1117 f6712bf72c19
child 1119 4363cfdb85b9
Whoops, dropped last extension from the list in legacy GL extension codepath.
mojoshader_opengl.c
--- a/mojoshader_opengl.c	Wed Oct 10 21:35:16 2012 -0400
+++ b/mojoshader_opengl.c	Wed Oct 10 22:47:27 2012 -0400
@@ -1117,19 +1117,23 @@
             while (1)
             {
                 const char ch = *str;
-                if (ch == '\0')
-                    break;
-                else if (!iswhitespace(ch))
+                if (ch && (!iswhitespace(ch)))
                 {
                     str++;
                     continue;
                 } // else if
 
-                if (!stringcache_len(exts, ext, (unsigned int) (str - ext)))
+                if (str != ext)
                 {
-                    out_of_memory();
+                    if (!stringcache_len(exts, ext, (unsigned int) (str - ext)))
+                    {
+                        out_of_memory();
+                        break;
+                    } // if
+                } // if
+
+                if (ch == '\0')
                     break;
-                } // if
 
                 str++;
                 while (*str && iswhitespace(*str))