diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/src/input.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/src/input.c b/cli/src/input.c index 8bfe14d6466..e762fbd1385 100644 --- a/cli/src/input.c +++ b/cli/src/input.c @@ -56,17 +56,19 @@ cli_input (void *d) int ret = 0; char cmdbuf[CMDBUFSIZ]; char *cmd = NULL; + size_t len = 0; state = d; for (;;) { - cli_out ("%s", state->prompt); + printf ("%s", state->prompt); cmd = fgets (cmdbuf, CMDBUFSIZ, stdin); if (!cmd) break; - - printf ("processing command: '%s'\n", cmd); + len = strlen(cmd); + if (len > 0 && cmd[len - 1] == '\n') //strip trailing \n + cmd[len - 1] = '\0'; ret = cli_cmd_process_line (state, cmd); } |