aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-09-13 22:20:37 +0000
committerpgf <pgf@69ca8d6d-28ef-0310-b511-8ec308f3f277>2005-09-13 22:20:37 +0000
commitebd5534c76104b2aca1f636096a9a01d32f7d340 (patch)
treecaf85d461b821432e02ec06a8a2e20458cefaa8d
parent3723cea7beb7bc3cb0162334c730d4dca1c8e7ed (diff)
downloadbusybox-w32-ebd5534c76104b2aca1f636096a9a01d32f7d340.tar.gz
busybox-w32-ebd5534c76104b2aca1f636096a9a01d32f7d340.tar.bz2
busybox-w32-ebd5534c76104b2aca1f636096a9a01d32f7d340.zip
allow either backspace or DEL, in addition to the user's erase
char, to be used in get_input_line() git-svn-id: svn://busybox.net/trunk/busybox@11451 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r--editors/vi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 6f739a714..374d161d1 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"
2416 c = get_one_char(); // read user input 2416 c = get_one_char(); // read user input
2417 if (c == '\n' || c == '\r' || c == 27) 2417 if (c == '\n' || c == '\r' || c == 27)
2418 break; // is this end of input 2418 break; // is this end of input
2419 if (c == erase_char) { // user wants to erase prev char 2419 if (c == erase_char || c == 8 || c == 127) {
2420 // user wants to erase prev char
2420 i--; // backup to prev char 2421 i--; // backup to prev char
2421 buf[i] = '\0'; // erase the char 2422 buf[i] = '\0'; // erase the char
2422 buf[i + 1] = '\0'; // null terminate buffer 2423 buf[i + 1] = '\0'; // null terminate buffer