projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
move debugging to safe place (before vfork)
[oweals/busybox.git]
/
coreutils
/
length.c
diff --git
a/coreutils/length.c
b/coreutils/length.c
index 4cbe7e17b088b2c105dda17a1036d3d8f3c0e2b0..bce43ab3ff7fdbc90684833eb4c53024d8816cbc 100644
(file)
--- a/
coreutils/length.c
+++ b/
coreutils/length.c
@@
-1,14
+1,19
@@
/* vi: set sw=4 ts=4: */
/* vi: set sw=4 ts=4: */
-#include "internal.h"
+
+/* BB_AUDIT SUSv3 N/A -- Apparently a busybox (obsolete?) extension. */
+
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#include "busybox.h"
extern int length_main(int argc, char **argv)
{
extern int length_main(int argc, char **argv)
{
- if (
argc != 2 || **(argv + 1) == '-'
) {
-
usage("length string\n"
);
+ if (
(argc != 2) || (**(++argv) == '-')
) {
+
bb_show_usage(
);
}
}
- printf("%lu\n", (long)strlen(argv[1]));
- return (TRUE);
+
+ bb_printf("%lu\n", (unsigned long)strlen(*argv));
+
+ bb_fflush_stdout_and_exit(EXIT_SUCCESS);
}
}