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 /coreutils | |
parent | 646129163a26171d48a335f7e22828848cf28cc5 (diff) |
remove outdated and do not corected comment. Use bb_xasprintf instead xmalloc+set+set+strcpy.
Diffstat (limited to 'coreutils')
-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 @@ #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 @@ extern int fold_main(int argc, char **argv) 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); } } } |