diff options
Diffstat (limited to 'coreutils')
-rw-r--r-- | coreutils/length.c | 14 |
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 | ||
6 | const char length_usage[] = "length string"; | 6 | extern int |
7 | 7 | length_main(int argc, char * * argv) | |
8 | int | ||
9 | length_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 | } |