Don't allow /alias to overwrite standard command

This commit is contained in:
James Booth
2014-01-25 01:39:12 +00:00
parent 17f40b76ee
commit 4bd06a5d87
7 changed files with 48 additions and 14 deletions

View File

@@ -132,6 +132,21 @@ autocomplete_get_list(Autocomplete ac)
return copy;
}
gboolean
autocomplete_contains(Autocomplete ac, char *value)
{
GSList *curr = ac->items;
while(curr) {
if (strcmp(curr->data, value) == 0) {
return TRUE;
}
curr = g_slist_next(curr);
}
return FALSE;
}
gchar *
autocomplete_complete(Autocomplete ac, gchar *search_str)
{

View File

@@ -56,4 +56,6 @@ char * autocomplete_param_no_with_func(char *input, int *size, char *command,
int arg_number, autocomplete_func func);
void autocomplete_reset(Autocomplete ac);
gboolean autocomplete_contains(Autocomplete ac, char *value);
#endif