Mesa (master): Revert "foo"

Emil Velikov evelikov at kemper.freedesktop.org
Mon Oct 30 15:34:54 UTC 2017


Module: Mesa
Branch: master
Commit: fc7816fd4ed33c7909345a5fbffac48d3afcc7fe
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc7816fd4ed33c7909345a5fbffac48d3afcc7fe

Author: Emil Velikov <emil.l.velikov at gmail.com>
Date:   Mon Oct 30 15:32:56 2017 +0000

Revert "foo"

This reverts commit 27d5a7bce09aef83d3349cca5f3777007b3b94b6.

I fat fingered it, failing to reset the checkout before applying the
sequential commit.

---

 src/compiler/glsl/linker.cpp | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp
index e7ec9b7bc0..f827b68555 100644
--- a/src/compiler/glsl/linker.cpp
+++ b/src/compiler/glsl/linker.cpp
@@ -3653,21 +3653,21 @@ included_in_packed_varying(ir_variable *var, const char *name)
    if (strncmp(var->name, "packed:", 7) != 0)
       return false;
 
-   const char *token = var->name + 7;
+   char *list = strdup(var->name + 7);
+   assert(list);
+
+   bool found = false;
+   char *saveptr;
+   char *token = strtok_r(list, ",", &saveptr);
    while (token) {
-      const char *next_token = strchr(list, ' ');
-      if (next_token) {
-         len = token - next_token;
-         next_token++;
-      } else {
-         len = strlen(token);
+      if (strcmp(token, name) == 0) {
+         found = true;
+         break;
       }
-      if (strncmp(token, name, MAX2(len, strlen(name)) == 0)
-         return true;
-
-      token = next_token;
+      token = strtok_r(NULL, ",", &saveptr);
    }
-   return false;
+   free(list);
+   return found;
 }
 
 /**




More information about the mesa-commit mailing list