lineedit: tiny shrink
authorDenis Vlasenko <vda.linux@googlemail.com>
Mon, 18 Feb 2008 22:28:03 +0000 (22:28 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Mon, 18 Feb 2008 22:28:03 +0000 (22:28 -0000)
libbb/lineedit.c

index 18cf7cc993a339d656e7139ae6a2d44d0d475978..529344f6c2e4e2c42350137943b9075fc286e5e8 100644 (file)
@@ -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);