diff options
author | James Booth <boothj5@gmail.com> | 2016-05-24 00:32:53 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2016-05-24 00:32:53 +0100 |
commit | f377e0329efe9f2b20a95c286a867c36cab0fce0 (patch) | |
tree | 67392e9210005f673960fbfe2ed016cbe00c7aef | |
parent | 6559263b2fed1edc6b004dc3e50697600e450b9b (diff) | |
download | profani-tty-f377e0329efe9f2b20a95c286a867c36cab0fce0.tar.gz |
Allow autocomplete for basic compelters when no input
-rw-r--r-- | src/tools/autocomplete.c | 6 |
1 files 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 |