From: Denis Vlasenko Date: Mon, 18 Feb 2008 22:28:03 +0000 (-0000) Subject: lineedit: tiny shrink X-Git-Tag: 1_10_0~139 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6f04391cecd8579f4bf5007b456e9ee79d718cff;p=oweals%2Fbusybox.git lineedit: tiny shrink --- 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);