svn commit: trunk/busybox/libbb

vda at busybox.net vda at busybox.net
Mon Feb 18 22:28:04 UTC 2008


Author: vda
Date: 2008-02-18 14:28:03 -0800 (Mon, 18 Feb 2008)
New Revision: 21056

Log:
lineedit: tiny shrink



Modified:
   trunk/busybox/libbb/lineedit.c


Changeset:
Modified: trunk/busybox/libbb/lineedit.c
===================================================================
--- trunk/busybox/libbb/lineedit.c	2008-02-18 22:10:05 UTC (rev 21055)
+++ trunk/busybox/libbb/lineedit.c	2008-02-18 22:28:03 UTC (rev 21056)
@@ -246,7 +246,15 @@
 	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);




More information about the busybox-cvs mailing list