[LIB]: Don't return struct declarations in cu__find_struct_by_name

Find the real thing instead.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
Arnaldo Carvalho de Melo 2007-01-23 16:25:24 -02:00
parent 4038bf3c4c
commit 30165f5c63
1 changed files with 3 additions and 1 deletions

View File

@ -524,7 +524,9 @@ struct tag *cu__find_struct_by_name(const struct cu *self, const char *name)
continue;
type = tag__type(pos);
if (type->name != NULL && strcmp(type->name, name) == 0)
if (!type->declaration &&
type->name != NULL &&
strcmp(type->name, name) == 0)
return pos;
}