diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2021-05-01 14:00:09 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2021-05-01 14:00:09 +0200 |
commit | 74e1f321c147753573e4b6bcd34e98708b5ece52 (patch) | |
tree | 90c2448f2e7604122cf7f8a94e987ca33bf54049 | |
parent | e6007c4911c3ea26925f9473b9f156a692585f30 (diff) | |
download | busybox-w32-74e1f321c147753573e4b6bcd34e98708b5ece52.tar.gz busybox-w32-74e1f321c147753573e4b6bcd34e98708b5ece52.tar.bz2 busybox-w32-74e1f321c147753573e4b6bcd34e98708b5ece52.zip |
vi: trivial code shrink
function old new delta
get_input_line 178 176 -2
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | editors/vi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/vi.c b/editors/vi.c index edcf84240..99babccbb 100644 --- a/editors/vi.c +++ b/editors/vi.c | |||
@@ -1200,7 +1200,7 @@ static char *get_input_line(const char *prompt) | |||
1200 | strcpy(buf, prompt); | 1200 | strcpy(buf, prompt); |
1201 | last_status_cksum = 0; // force status update | 1201 | last_status_cksum = 0; // force status update |
1202 | go_bottom_and_clear_to_eol(); | 1202 | go_bottom_and_clear_to_eol(); |
1203 | write1(prompt); // write out the :, /, or ? prompt | 1203 | write1(buf); // write out the :, /, or ? prompt |
1204 | 1204 | ||
1205 | i = strlen(buf); | 1205 | i = strlen(buf); |
1206 | while (i < MAX_INPUT_LEN - 1) { | 1206 | while (i < MAX_INPUT_LEN - 1) { |
@@ -1209,8 +1209,8 @@ static char *get_input_line(const char *prompt) | |||
1209 | break; // this is end of input | 1209 | break; // this is end of input |
1210 | if (c == term_orig.c_cc[VERASE] || c == 8 || c == 127) { | 1210 | if (c == term_orig.c_cc[VERASE] || c == 8 || c == 127) { |
1211 | // user wants to erase prev char | 1211 | // user wants to erase prev char |
1212 | buf[--i] = '\0'; | ||
1213 | write1("\b \b"); // erase char on screen | 1212 | write1("\b \b"); // erase char on screen |
1213 | buf[--i] = '\0'; | ||
1214 | if (i <= 0) // user backs up before b-o-l, exit | 1214 | if (i <= 0) // user backs up before b-o-l, exit |
1215 | break; | 1215 | break; |
1216 | } else if (c > 0 && c < 256) { // exclude Unicode | 1216 | } else if (c > 0 && c < 256) { // exclude Unicode |