about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-11-05 09:24:17 +0100
committerMichael Vetter <jubalh@iodoru.org>2020-11-05 09:24:17 +0100
commit2184e92c19ea1123efacedd665782179e70c8121 (patch)
tree5967730d27871e7bc682301acad0c0156088436d /src
parent3d307fe3418919b42bc00a7e171f0c3050c8d8e6 (diff)
downloadprofani-tty-2184e92c19ea1123efacedd665782179e70c8121.tar.gz
Simplify cmd_ac_complete()
Diffstat (limited to 'src')
-rw-r--r--src/command/cmd_ac.c12
1 files 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