diff options
author | Emil Velikov <[email protected]> | 2017-10-25 14:52:55 +0100 |
---|---|---|
committer | Emil Velikov <[email protected]> | 2017-10-30 15:22:26 +0000 |
commit | 27d5a7bce09aef83d3349cca5f3777007b3b94b6 (patch) | |
tree | 84f9f07c72627de44a2087c76fdecae4dabcb73c /src/compiler/glsl | |
parent | a8b1715b8ab974518f9713b82955f049a2c1c7ec (diff) |
foo
Signed-off-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/linker.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/compiler/glsl/linker.cpp b/src/compiler/glsl/linker.cpp index f827b68555f..e7ec9b7bc03 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; - char *list = strdup(var->name + 7); - assert(list); - - bool found = false; - char *saveptr; - char *token = strtok_r(list, ",", &saveptr); + const char *token = var->name + 7; while (token) { - if (strcmp(token, name) == 0) { - found = true; - break; + const char *next_token = strchr(list, ' '); + if (next_token) { + len = token - next_token; + next_token++; + } else { + len = strlen(token); } - token = strtok_r(NULL, ",", &saveptr); + if (strncmp(token, name, MAX2(len, strlen(name)) == 0) + return true; + + token = next_token; } - free(list); - return found; + return false; } /** |