diff --git a/client/main.c b/client/main.c
index 2cb449f..0095aa0 100644
--- a/client/main.c
+++ b/client/main.c
if (start > 0) {
int i;
+ char *input_cmd;
+ input_cmd = g_strndup(rl_line_buffer, start -1);
for (i = 0; cmd_table[i].cmd; i++) {
- if (strncmp(cmd_table[i].cmd,
- rl_line_buffer, start - 1))
+ if (strcmp(cmd_table[i].cmd, input_cmd))
continue;
if (!cmd_table[i].gen)
matches = rl_completion_matches(text, cmd_table[i].gen);
break;
}
+ g_free(input_cmd);
} else {
rl_completion_display_matches_hook = NULL;
matches = rl_completion_matches(text, cmd_generator);