1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Tidied form field autocompleters

This commit is contained in:
James Booth 2015-05-05 00:13:41 +01:00
parent 6f3750c6aa
commit d52f86ef0f

View File

@ -1653,7 +1653,10 @@ cmd_autocomplete_add(char *value)
void
cmd_autocomplete_add_form_fields(DataForm *form)
{
if (form) {
if (form == NULL) {
return;
}
GSList *fields = autocomplete_create_list(form->tag_ac);
GSList *curr_field = fields;
while (curr_field) {
@ -1664,13 +1667,15 @@ cmd_autocomplete_add_form_fields(DataForm *form)
curr_field = g_slist_next(curr_field);
}
g_slist_free_full(fields, free);
}
}
void
cmd_autocomplete_remove_form_fields(DataForm *form)
{
if (form) {
if (form == NULL) {
return;
}
GSList *fields = autocomplete_create_list(form->tag_ac);
GSList *curr_field = fields;
while (curr_field) {
@ -1681,7 +1686,6 @@ cmd_autocomplete_remove_form_fields(DataForm *form)
curr_field = g_slist_next(curr_field);
}
g_slist_free_full(fields, free);
}
}
void