From ff6af96bc7c8c3575b0b554ec98c8ede1263e5ab Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Wed, 25 Mar 2009 23:25:38 +0100 Subject: [PATCH] hdt: in the cli, we have to Skip empty lines Impact: empty lines were confusing history History works better when we ignore empty lines --- com32/hdt/hdt-cli.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index 9ff6d90..8e71690 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -497,6 +497,12 @@ void start_cli_mode(struct s_hardware *hardware) case KEY_ENTER: more_printf("\n"); + + /* We have to skip empty lines */ + if (strlen(skipspace(cli.input))<1) { + reset_prompt(&cli); + break; + } if (cli.history_pos == MAX_HISTORY_SIZE-1) cli.history_pos=1; strncpy(cli.history[cli.history_pos],skipspace(cli.input),sizeof(cli.history[cli.history_pos])); cli.history_pos++; -- 2.7.4