diff options
author | James Booth <boothj5@gmail.com> | 2016-05-24 01:28:04 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-05-24 01:28:04 +0100 |
commit | e183fd918614dcbecfc10203d660d2607d1f4f27 (patch) | |
tree | ac8df7360f4d22c9b2b2a677efb81a108b7ee551 /src | |
parent | f377e0329efe9f2b20a95c286a867c36cab0fce0 (diff) | |
download | profani-tty-e183fd918614dcbecfc10203d660d2607d1f4f27.tar.gz |
Allow empty autocomplete for /otr policy
Diffstat (limited to 'src')
-rw-r--r-- | src/command/cmd_ac.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index e43bcdb1..5cc0405a 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -1707,13 +1707,11 @@ _log_autocomplete(ProfWin *window, const char *const input) { char *result = NULL; - result = autocomplete_param_with_func(input, "/log rotate", - prefs_autocomplete_boolean_choice); + result = autocomplete_param_with_func(input, "/log rotate", prefs_autocomplete_boolean_choice); if (result) { return result; } - result = autocomplete_param_with_func(input, "/log shared", - prefs_autocomplete_boolean_choice); + result = autocomplete_param_with_func(input, "/log shared", prefs_autocomplete_boolean_choice); if (result) { return result; } @@ -1765,12 +1763,14 @@ _otr_autocomplete(ProfWin *window, const char *const input) // /otr policy always user@server.com if (conn_status == JABBER_CONNECTED) { gboolean result; - gchar **args = parse_args(input, 3, 3, &result); + gchar **args = parse_args(input, 2, 3, &result); if (result && (strcmp(args[0], "policy") == 0)) { GString *beginning = g_string_new("/otr "); 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]); + } found = autocomplete_param_with_func(input, beginning->str, roster_contact_autocomplete); g_string_free(beginning, TRUE); |