aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
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 @@
3#include <string.h> 3#include <string.h>
4#include <stdio.h> 4#include <stdio.h>
5 5
6const char length_usage[] = "length string"; 6extern int
7 7length_main(int argc, char * * argv)
8int
9length_main(struct FileInfo * i, int argc, char * * argv)
10{ 8{
11 printf("%d\n", strlen(argv[1])); 9 if ( **(argv+1) == '-' ) {
12 return 0; 10 fprintf(stderr, "Usage: length string\n");
11 exit(FALSE);
12 }
13 printf("%d\n", strlen(argv[1]));
14 return( TRUE);
13} 15}