summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/glsl/glcpp/glcpp-parse.y18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index 9d8b5bbb0b6..3fc8c868b07 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -939,14 +939,16 @@ _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b)
if (node_a == NULL || node_b == NULL)
return 0;
-
- if (node_a->token->type == SPACE) {
- node_a = node_a->next;
- continue;
- }
-
- if (node_b->token->type == SPACE) {
- node_b = node_b->next;
+ /* Make sure whitespace appears in the same places in both.
+ * It need not be exactly the same amount of whitespace,
+ * though.
+ */
+ if (node_a->token->type == SPACE
+ && node_b->token->type == SPACE) {
+ while (node_a->token->type == SPACE)
+ node_a = node_a->next;
+ while (node_b->token->type == SPACE)
+ node_b = node_b->next;
continue;
}