mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-21 22:26:21 +00:00
Free autocompleters on quit
This commit is contained in:
@@ -367,25 +367,32 @@ cmd_init(void)
|
||||
unsigned int i;
|
||||
for (i = 0; i < ARRAY_SIZE(main_commands); i++) {
|
||||
struct cmd_t *pcmd = main_commands+i;
|
||||
p_autocomplete_add(commands_ac, (gchar *)pcmd->cmd);
|
||||
p_autocomplete_add(help_ac, (gchar *)pcmd->cmd+1);
|
||||
p_autocomplete_add(commands_ac, (gchar *)strdup(pcmd->cmd));
|
||||
p_autocomplete_add(help_ac, (gchar *)strdup(pcmd->cmd+1));
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(setting_commands); i++) {
|
||||
struct cmd_t *pcmd = setting_commands+i;
|
||||
p_autocomplete_add(commands_ac, (gchar *)pcmd->cmd);
|
||||
p_autocomplete_add(help_ac, (gchar *)pcmd->cmd+1);
|
||||
p_autocomplete_add(commands_ac, (gchar *)strdup(pcmd->cmd));
|
||||
p_autocomplete_add(help_ac, (gchar *)strdup(pcmd->cmd+1));
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(status_commands); i++) {
|
||||
struct cmd_t *pcmd = status_commands+i;
|
||||
p_autocomplete_add(commands_ac, (gchar *)pcmd->cmd);
|
||||
p_autocomplete_add(help_ac, (gchar *)pcmd->cmd+1);
|
||||
p_autocomplete_add(commands_ac, (gchar *)strdup(pcmd->cmd));
|
||||
p_autocomplete_add(help_ac, (gchar *)strdup(pcmd->cmd+1));
|
||||
}
|
||||
|
||||
history_init();
|
||||
}
|
||||
|
||||
void
|
||||
cmd_close(void)
|
||||
{
|
||||
p_autocomplete_clear(commands_ac);
|
||||
p_autocomplete_clear(help_ac);
|
||||
}
|
||||
|
||||
// Command autocompletion functions
|
||||
|
||||
char *
|
||||
|
||||
Reference in New Issue
Block a user