summaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorPaul Fox2005-09-13 22:20:37 +0000
committerPaul Fox2005-09-13 22:20:37 +0000
commitf2de0b7ae4d631cd717dde251ceee2de6bb0f44e (patch)
treecaf85d461b821432e02ec06a8a2e20458cefaa8d /editors/vi.c
parent676e95ea3da081f52325233f5aa89f04b097f452 (diff)
downloadbusybox-f2de0b7ae4d631cd717dde251ceee2de6bb0f44e.zip
busybox-f2de0b7ae4d631cd717dde251ceee2de6bb0f44e.tar.gz
allow either backspace or DEL, in addition to the user's erase
char, to be used in get_input_line()
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 6f739a7..374d161 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2416,7 +2416,8 @@ static Byte *get_input_line(Byte * prompt) // get input line- use "status line"
c = get_one_char(); // read user input
if (c == '\n' || c == '\r' || c == 27)
break; // is this end of input
- if (c == erase_char) { // user wants to erase prev char
+ if (c == erase_char || c == 8 || c == 127) {
+ // user wants to erase prev char
i--; // backup to prev char
buf[i] = '\0'; // erase the char
buf[i + 1] = '\0'; // null terminate buffer