diff options
author | James Booth <boothj5@gmail.com> | 2016-05-24 01:43:45 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-05-24 01:43:45 +0100 |
commit | e8b25780399dda78a3f5ee0dfa94017316c9d7e6 (patch) | |
tree | 4b79d73c39b1e59fd14608b4492bf7c6c75fa14f | |
parent | 492c1bfa14cc4c67777bf9473d6f2f678dbe3f4f (diff) | |
download | profani-tty-e8b25780399dda78a3f5ee0dfa94017316c9d7e6.tar.gz |
Complete no arg for /affiliation set
-rw-r--r-- | src/command/cmd_ac.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index 534afc0f..8b902c34 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -2268,13 +2268,15 @@ _affiliation_autocomplete(ProfWin *window, const char *const input) gboolean parse_result; Autocomplete jid_ac = muc_roster_jid_ac(mucwin->roomjid); - gchar **args = parse_args(input, 3, 3, &parse_result); + gchar **args = parse_args(input, 2, 3, &parse_result); if ((strncmp(input, "/affiliation", 12) == 0) && (parse_result == TRUE)) { GString *beginning = g_string_new("/affiliation "); g_string_append(beginning, args[0]); g_string_append(beginning, " "); - g_string_append(beginning, args[1]); + if (args[1]) { + g_string_append(beginning, args[1]); + } result = autocomplete_param_with_ac(input, beginning->str, jid_ac, TRUE); g_string_free(beginning, TRUE); |