diff options
author | Erwan Velu <erwan.velu@free.fr> | 2009-03-25 23:25:38 +0100 |
---|---|---|
committer | Erwan Velu <erwan.velu@free.fr> | 2009-03-26 18:28:47 +0100 |
commit | ff6af96bc7c8c3575b0b554ec98c8ede1263e5ab (patch) | |
tree | 99470d46443a2b600aeb1c6bc338243bbc7cd99f | |
parent | aba85bbc1d1ca6960f14e7e7ccf3520541e2c7ea (diff) | |
download | syslinux.git-ff6af96bc7c8c3575b0b554ec98c8ede1263e5ab.tar.gz syslinux.git-ff6af96bc7c8c3575b0b554ec98c8ede1263e5ab.tar.xz syslinux.git-ff6af96bc7c8c3575b0b554ec98c8ede1263e5ab.zip |
hdt: in the cli, we have to Skip empty lines
Impact: empty lines were confusing history
History works better when we ignore empty lines
-rw-r--r-- | com32/hdt/hdt-cli.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index 9ff6d90f..8e716904 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++; |