mojoshader_opengl.c
changeset 1118 c383aebc9f13
parent 1117 f6712bf72c19
child 1124 464fc9101a7e
--- 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))