summaryrefslogtreecommitdiff
path: root/editors/vi.c
diff options
context:
space:
mode:
authorDenys Vlasenko2021-05-01 14:00:09 +0200
committerDenys Vlasenko2021-05-01 14:00:09 +0200
commit74e1f321c147753573e4b6bcd34e98708b5ece52 (patch)
tree90c2448f2e7604122cf7f8a94e987ca33bf54049 /editors/vi.c
parente6007c4911c3ea26925f9473b9f156a692585f30 (diff)
downloadbusybox-74e1f321c147753573e4b6bcd34e98708b5ece52.zip
busybox-74e1f321c147753573e4b6bcd34e98708b5ece52.tar.gz
vi: trivial code shrink
function old new delta get_input_line 178 176 -2 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'editors/vi.c')
-rw-r--r--editors/vi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c
index edcf842..99babcc 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -1200,7 +1200,7 @@ static char *get_input_line(const char *prompt)
strcpy(buf, prompt);
last_status_cksum = 0; // force status update
go_bottom_and_clear_to_eol();
- write1(prompt); // write out the :, /, or ? prompt
+ write1(buf); // write out the :, /, or ? prompt
i = strlen(buf);
while (i < MAX_INPUT_LEN - 1) {
@@ -1209,8 +1209,8 @@ static char *get_input_line(const char *prompt)
break; // this is end of input
if (c == term_orig.c_cc[VERASE] || c == 8 || c == 127) {
// user wants to erase prev char
- buf[--i] = '\0';
write1("\b \b"); // erase char on screen
+ buf[--i] = '\0';
if (i <= 0) // user backs up before b-o-l, exit
break;
} else if (c > 0 && c < 256) { // exclude Unicode