@techee commented on this pull request.
- if (*header == NULL && g_strcmp0(hdr_comps[0], src_comps[0]) == 0) - *header = hdr; - g_hash_table_add(includes, hdr); - g_strfreev(hdr_comps); + for (j = 0; j < tm_files->len; j++) + { + TMSourceFile *hdr = tm_files->pdata[j]; + gchar **hdr_comps = g_strsplit(hdr->short_name, ".", 2); + + if (g_strcmp0(hdr_comps[0], src_comps[0]) == 0)
Ah, `g_ptr_array_find()` was introduced in glib 2.54 which we don't have. Wouldn't be hard to implemented, it's jut an extra complication and maybe using the list is a simpler solution then (despite some extra allocation which I think won't matter much in this case).