diff options
author | James Booth <boothj5@gmail.com> | 2015-01-16 23:12:00 +0000 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2015-01-16 23:12:00 +0000 |
commit | 972d524fdcbcf7d706f5970853180a856ff044b8 (patch) | |
tree | 613b1a215ede3314cd4600783550baf849dda7ce /src/muc.c | |
parent | 9fad03af747a2345fa3da7d071a6acd1017d204b (diff) | |
parent | 4c6cfcdca0f7aec1f0e3243a60d88ed494357a5d (diff) | |
download | profani-tty-972d524fdcbcf7d706f5970853180a856ff044b8.tar.gz |
Merge branch 'master' into inp-utf8
Diffstat (limited to 'src/muc.c')
-rw-r--r-- | src/muc.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/muc.c b/src/muc.c index 74e0d66e..f50f3879 100644 --- a/src/muc.c +++ b/src/muc.c @@ -141,7 +141,7 @@ muc_invites_reset_ac(void) } char * -muc_invites_find(char *search_str) +muc_invites_find(const char * const search_str) { return autocomplete_complete(invite_ac, search_str, TRUE); } @@ -632,8 +632,8 @@ muc_roster_nick_change_complete(const char * const room, return NULL; } -void -muc_autocomplete(char *input, int *size) +char * +muc_autocomplete(const char * const input) { win_type_t wintype = ui_current_win_type(); if (wintype == WIN_MUC) { @@ -641,8 +641,7 @@ muc_autocomplete(char *input, int *size) ChatRoom *chat_room = g_hash_table_lookup(rooms, mucwin->roomjid); if (chat_room && chat_room->nick_ac) { - input[*size] = '\0'; - char *search_str = NULL; + const char * search_str = NULL; gchar *last_space = g_strrstr(input, " "); if (!last_space) { @@ -664,12 +663,15 @@ muc_autocomplete(char *input, int *size) if (!last_space || (*(last_space+1) == '\0')) { g_string_append(replace_with, ": "); } - ui_replace_input(input, replace_with->str, size); - g_string_free(replace_with, TRUE); g_free(result); + result = replace_with->str; + g_string_free(replace_with, FALSE); + return result; } } } + + return NULL; } void |