From ebb8431452a58a41e71d0e21d8ef485c2d69a7c9 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Wed, 10 Oct 2012 22:47:27 -0400 Subject: [PATCH] Whoops, dropped last extension from the list in legacy GL extension codepath. --- mojoshader_opengl.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/mojoshader_opengl.c b/mojoshader_opengl.c index b9d3d570..3a2e6d34 100644 --- a/mojoshader_opengl.c +++ b/mojoshader_opengl.c @@ -1117,20 +1117,24 @@ static void load_extensions(MOJOSHADER_glGetProcAddress lookup, void *d) 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(); - break; + if (!stringcache_len(exts, ext, (unsigned int) (str - ext))) + { + out_of_memory(); + break; + } // if } // if + if (ch == '\0') + break; + str++; while (*str && iswhitespace(*str)) str++;