diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2006-01-30 10:49:14 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2006-01-30 10:49:14 +0000 |
commit | b1fd52e0b7e58a678766d2f67190d9b30399b628 (patch) | |
tree | 0750dccc0617906637830201252edb48ec418ef1 | |
parent | 646129163a26171d48a335f7e22828848cf28cc5 (diff) | |
download | busybox-w32-b1fd52e0b7e58a678766d2f67190d9b30399b628.tar.gz busybox-w32-b1fd52e0b7e58a678766d2f67190d9b30399b628.tar.bz2 busybox-w32-b1fd52e0b7e58a678766d2f67190d9b30399b628.zip |
remove outdated and do not corected comment. Use bb_xasprintf instead xmalloc+set+set+strcpy.
-rw-r--r-- | coreutils/fold.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/coreutils/fold.c b/coreutils/fold.c index 53ef44681..85b15f4d8 100644 --- a/coreutils/fold.c +++ b/coreutils/fold.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <unistd.h> | 18 | #include <unistd.h> |
19 | #include "busybox.h" | 19 | #include "busybox.h" |
20 | 20 | ||
21 | /* If nonzero, count bytes, not column positions. */ | ||
22 | static unsigned long flags; | 21 | static unsigned long flags; |
23 | #define FLAG_COUNT_BYTES 1 | 22 | #define FLAG_COUNT_BYTES 1 |
24 | #define FLAG_BREAK_SPACES 2 | 23 | #define FLAG_BREAK_SPACES 2 |
@@ -58,16 +57,11 @@ extern int fold_main(int argc, char **argv) | |||
58 | for (i = 1; i < argc; i++) { | 57 | for (i = 1; i < argc; i++) { |
59 | char const *a = argv[i]; | 58 | char const *a = argv[i]; |
60 | 59 | ||
61 | if (a[0] == '-') { | 60 | if (*a++ == '-') { |
62 | if (a[1] == '-' && !a[2]) | 61 | if (*a == '-' && !a[1]) |
63 | break; | 62 | break; |
64 | if (isdigit(a[1])) { | 63 | if (isdigit(*a)) { |
65 | char *s = xmalloc(strlen(a) + 2); | 64 | argv[i] = bb_xasprintf("-w%s", a); |
66 | |||
67 | s[0] = '-'; | ||
68 | s[1] = 'w'; | ||
69 | strcpy(s + 2, a + 1); | ||
70 | argv[i] = s; | ||
71 | } | 65 | } |
72 | } | 66 | } |
73 | } | 67 | } |