aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>1999-10-18 21:31:00 +0000
committerEric Andersen <andersen@codepoet.org>1999-10-18 21:31:00 +0000
commit703c62da63aa31d665a8215f373b26e4b54f1bf4 (patch)
tree44f14eeafa69317a3a053760492ca5f8bf80645e /coreutils
parent8759006b55c617811a207cc4e99792996c8b97fb (diff)
downloadbusybox-703c62da63aa31d665a8215f373b26e4b54f1bf4.tar.gz
More stuff
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/length.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/coreutils/length.c b/coreutils/length.c
index 284bbfdf9..f2dadd25c 100644
--- a/coreutils/length.c
+++ b/coreutils/length.c
@@ -3,11 +3,13 @@
#include <string.h>
#include <stdio.h>
-const char length_usage[] = "length string";
-
-int
-length_main(struct FileInfo * i, int argc, char * * argv)
+extern int
+length_main(int argc, char * * argv)
{
- printf("%d\n", strlen(argv[1]));
- return 0;
+ if ( **(argv+1) == '-' ) {
+ fprintf(stderr, "Usage: length string\n");
+ exit(FALSE);
+ }
+ printf("%d\n", strlen(argv[1]));
+ return( TRUE);
}