aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-02-18 22:28:03 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-02-18 22:28:03 +0000
commit6f04391cecd8579f4bf5007b456e9ee79d718cff (patch)
tree608ea3d5e50d118b854998cb0afa3009f93f0dc8
parentde7684a309ad20c1b889d048d741cb1dd52245f7 (diff)
downloadbusybox-6f04391cecd8579f4bf5007b456e9ee79d718cff.tar.gz
lineedit: tiny shrink
-rw-r--r--libbb/lineedit.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 18cf7cc99..529344f6c 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -246,7 +246,15 @@ static void input_backward(unsigned num)
if (cmdedit_x >= num) {
cmdedit_x -= num;
if (num <= 4) {
- printf("\b\b\b\b" + (4-num));
+ /* This is longer by 5 bytes on x86.
+ * Also gets mysteriously
+ * miscompiled for some ARM users.
+ * printf(("\b\b\b\b" + 4) - num);
+ * return;
+ */
+ do {
+ bb_putchar('\b');
+ } while (--num);
return;
}
printf("\033[%uD", num);