aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErwan Velu <erwan.velu@free.fr>2009-03-25 23:25:38 +0100
committerErwan Velu <erwan.velu@free.fr>2009-03-25 23:25:38 +0100
commit84fa14d88f0dfb8db929e7163b30718f9d104654 (patch)
tree53e52eabf90af47e81c595e4148546d8cf9fb8e2
parentfdadbcfeaa8015461e557fae2beb6a484986d097 (diff)
downloadsyslinux.git-84fa14d88f0dfb8db929e7163b30718f9d104654.tar.gz
syslinux.git-84fa14d88f0dfb8db929e7163b30718f9d104654.tar.xz
syslinux.git-84fa14d88f0dfb8db929e7163b30718f9d104654.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.c6
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++;