glcpp: Regenerate glcpp-parse.c
authorChad Versace <chad.versace@intel.com>
Tue, 11 Jan 2011 01:09:24 +0000 (17:09 -0800)
committerChad Versace <chad.versace@intel.com>
Tue, 11 Jan 2011 01:28:24 +0000 (17:28 -0800)
src/glsl/glcpp/glcpp-parse.c

index ab7c30ed78a7a3076800acd25c29fdde99b6bab1..55ec165d70f28b8c9cb9f60ab70dc83b1bd7b644 100644 (file)
@@ -3149,11 +3149,32 @@ _token_list_trim_trailing_space (token_list_t *list)
        }
 }
 
+int
+_token_list_is_empty_ignoring_space (token_list_t *l)
+{
+       token_node_t *n;
+
+       if (l == NULL)
+               return 1;
+
+       n = l->head;
+       while (n != NULL && n->token->type == SPACE)
+               n = n->next;
+
+       return n == NULL;
+}
+
 int
 _token_list_equal_ignoring_space (token_list_t *a, token_list_t *b)
 {
        token_node_t *node_a, *node_b;
 
+       if (a == NULL || b == NULL) {
+               int a_empty = _token_list_is_empty_ignoring_space(a);
+               int b_empty = _token_list_is_empty_ignoring_space(b);
+               return a_empty == b_empty;
+       }
+
        node_a = a->head;
        node_b = b->head;