Shell search provider always returns all SSH keys
When using the shell search provider I can enter anything and seahorse will return all SSH keys as matches, even if the search terms are not found anywhere.
This is because Seahorse.Predicate
stores the terms as void *
in custom_target
and that's also what object_matches_search
uses as argument type. This apparently (from looking at the generated C code, because I don't know anything about Vala) loses the length:
term_collection = (gchar**) terms;
term_collection_length1 = -1;
for (term_it = 0; term_it < term_collection_length1; term_it = term_it + 1) {
This causes the entire foreach
loop to be skipped and object_matches_search
returns true, regardless of what the search terms were.
Replacing the void *
with a string[]
in all the relevant places seems to fix this, but makes this less generic. On the other hand Seahorse.Predicate
is only used for string[]
. But I really don't know anything about Vala, so I'll leave coming up with a proper solution to someone who does.