From: Pierre-Alexandre Meyer Date: Sat, 11 Apr 2009 17:50:30 +0000 (-0700) Subject: hdt: DEL must be handle as BACKSPACE X-Git-Tag: syslinux-3.80-pre1~17^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d72bfe6108c5104bb095f1c3f9f35885ddf8da88;p=platform%2Fupstream%2Fsyslinux.git hdt: DEL must be handle as BACKSPACE Impact: Better conformity to standards To conform with serial lines, DEL must be handled as BACKSPACE Using Ctrl+D to delete a char Taken from http://www.gnu.org/software/bash/manual/html_node/Commands-For-Text.html (cherry picked from commit 5be7f0228dea745aa8e1fe18036517675bbe8c1e) --- diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index ee1dce5..3fd7ce4 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -899,12 +899,12 @@ void start_cli_mode(struct s_hardware *hardware) reset_prompt(); break; - case KEY_DELETE: - case KEY_DEL: - /* No need to delete when input is empty */ - if (strlen(hdt_cli.input)==0) break; - /* Don't delete when cursor is at the end of the line */ - if (hdt_cli.cursor_pos>=strlen(hdt_cli.input)) break; + case KEY_CTRL('d'): + case KEY_DELETE: + /* No need to delete when input is empty */ + if (strlen(hdt_cli.input)==0) break; + /* Don't delete when cursor is at the end of the line */ + if (hdt_cli.cursor_pos>=strlen(hdt_cli.input)) break; for (int c = hdt_cli.cursor_pos; c < (int)strlen(hdt_cli.input) - 1; c++) @@ -922,6 +922,7 @@ void start_cli_mode(struct s_hardware *hardware) move_cursor_left(strlen(hdt_cli.input + hdt_cli.cursor_pos)); break; + case KEY_DEL: case KEY_BACKSPACE: /* Don't delete prompt */ if (hdt_cli.cursor_pos == 0)