diff options
Diffstat (limited to 'src/cli.c')
-rw-r--r-- | src/cli.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -92,6 +92,8 @@ static void cli_complete(char *line) const HIST_ENTRY *hist; const char *c; LIST_HEAD(msgs); + int len; + char *s; if (line == NULL) { printf("\n"); @@ -119,6 +121,12 @@ static void cli_complete(char *line) if (hist == NULL || strcmp(hist->line, line)) add_history(line); + len = strlen(line); + s = xmalloc(len + 2); + snprintf(s, len + 2, "%s\n", line); + xfree(line); + line = s; + parser_init(state, &msgs); scanner_push_buffer(scanner, &indesc_cli, line); nft_run(scanner, state, &msgs); |