From 2184e92c19ea1123efacedd665782179e70c8121 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Thu, 5 Nov 2020 09:24:17 +0100 Subject: [PATCH] Simplify cmd_ac_complete() --- src/command/cmd_ac.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/command/cmd_ac.c b/src/command/cmd_ac.c index 12b2ae9d..e3777e93 100644 --- a/src/command/cmd_ac.c +++ b/src/command/cmd_ac.c @@ -1171,23 +1171,17 @@ cmd_ac_remove_form_fields(DataForm* form) char* cmd_ac_complete(ProfWin* window, const char* const input, gboolean previous) { + char *found = NULL; // autocomplete command if ((strncmp(input, "/", 1) == 0) && (!strchr(input, ' '))) { - char* found = NULL; found = autocomplete_complete(commands_ac, input, TRUE, previous); - if (found) { - return found; - } // autocomplete parameters } else { - char* found = _cmd_ac_complete_params(window, input, previous); - if (found) { - return found; - } + found = _cmd_ac_complete_params(window, input, previous); } - return NULL; + return found; } void