Bug 585328 - Only set zero_terminated flag for types we know are

Rationalize our setting of the zero_terminated flag; we shouldn't
set it if the gir doesn't say to.
This commit is contained in:
Simon van der Linden 2009-06-17 17:30:19 -04:00 committed by Colin Walters
parent 1a256fd7bd
commit 0a046b7aa0

View File

@ -1710,6 +1710,12 @@ start_type (GMarkupParseContext *context,
typenode->has_size = size != NULL; typenode->has_size = size != NULL;
typenode->size = typenode->has_size ? atoi (size) : -1; typenode->size = typenode->has_size ? atoi (size) : -1;
if (zero)
typenode->zero_terminated = strcmp(zero, "1") == 0;
else
/* If neither zero-terminated nor length nor fixed-size is given, assume zero-terminated. */
typenode->zero_terminated = !(typenode->has_length || typenode->has_size);
} }
else else
{ {