From f377e0329efe9f2b20a95c286a867c36cab0fce0 Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 24 May 2016 00:32:53 +0100 Subject: [PATCH] Allow autocomplete for basic compelters when no input --- src/tools/autocomplete.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/tools/autocomplete.c b/src/tools/autocomplete.c index dc071357..2484a6e1 100644 --- a/src/tools/autocomplete.c +++ b/src/tools/autocomplete.c @@ -224,7 +224,7 @@ autocomplete_param_with_func(const char *const input, char *command, autocomplet sprintf(command_cpy, "%s ", command); int len = strlen(command_cpy); - if ((strncmp(input, command_cpy, len) == 0) && (strlen(input) > len)) { + if (strncmp(input, command_cpy, len) == 0) { int i; int inp_len = strlen(input); char prefix[inp_len]; @@ -255,7 +255,7 @@ autocomplete_param_with_ac(const char *const input, char *command, Autocomplete sprintf(command_cpy, "%s ", command); int len = strlen(command_cpy); int inp_len = strlen(input); - if ((strncmp(input, command_cpy, len) == 0) && (strlen(input) > len)) { + if (strncmp(input, command_cpy, len) == 0) { int i; char prefix[inp_len]; for(i = len; i < inp_len; i++) { @@ -280,7 +280,7 @@ autocomplete_param_with_ac(const char *const input, char *command, Autocomplete char* autocomplete_param_no_with_func(const char *const input, char *command, int arg_number, autocomplete_func func) { - if (strncmp(input, command, strlen(command)) == 0 && (strlen(input) > strlen(command))) { + if (strncmp(input, command, strlen(command)) == 0) { GString *result_str = NULL; // count tokens properly