svn commit: trunk/busybox/coreutils

vodz at busybox.net vodz at busybox.net
Mon Jan 30 10:49:16 UTC 2006


Author: vodz
Date: 2006-01-30 02:49:14 -0800 (Mon, 30 Jan 2006)
New Revision: 13703

Log:
remove outdated and do not corected comment. Use bb_xasprintf instead xmalloc+set+set+strcpy.

Modified:
   trunk/busybox/coreutils/fold.c


Changeset:
Modified: trunk/busybox/coreutils/fold.c
===================================================================
--- trunk/busybox/coreutils/fold.c	2006-01-30 09:39:51 UTC (rev 13702)
+++ trunk/busybox/coreutils/fold.c	2006-01-30 10:49:14 UTC (rev 13703)
@@ -18,7 +18,6 @@
 #include <unistd.h>
 #include "busybox.h"
 
-/* If nonzero, count bytes, not column positions. */
 static unsigned long flags;
 #define FLAG_COUNT_BYTES	1
 #define FLAG_BREAK_SPACES	2
@@ -58,16 +57,11 @@
 		for (i = 1; i < argc; i++) {
 			char const *a = argv[i];
 
-			if (a[0] == '-') {
-				if (a[1] == '-' && !a[2])
+			if (*a++ == '-') {
+				if (*a == '-' && !a[1])
 					break;
-				if (isdigit(a[1])) {
-					char *s = xmalloc(strlen(a) + 2);
-
-					s[0] = '-';
-					s[1] = 'w';
-					strcpy(s + 2, a + 1);
-					argv[i] = s;
+				if (isdigit(*a)) {
+					argv[i] = bb_xasprintf("-w%s", a);
 				}
 			}
 		}




More information about the busybox-cvs mailing list