aboutsummaryrefslogtreecommitdiff
path: root/cat.c
diff options
context:
space:
mode:
Diffstat (limited to 'cat.c')
-rw-r--r--cat.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/cat.c b/cat.c
index 0f2460eb7..8718c4d02 100644
--- a/cat.c
+++ b/cat.c
@@ -29,9 +29,9 @@ extern int cat_more_main(int argc, char **argv)
29 int c; 29 int c;
30 FILE *file = stdin; 30 FILE *file = stdin;
31 31
32 if (argc < 2) { 32 if ( (argc < 2) || (**(argv+1) == '-') ) {
33 fprintf(stderr, "Usage: %s %s", *argv, cat_usage); 33 fprintf(stderr, "Usage: %s %s", *argv, cat_usage);
34 return(FALSE); 34 exit(FALSE);
35 } 35 }
36 argc--; 36 argc--;
37 argv++; 37 argv++;
@@ -40,7 +40,7 @@ extern int cat_more_main(int argc, char **argv)
40 file = fopen(*argv, "r"); 40 file = fopen(*argv, "r");
41 if (file == NULL) { 41 if (file == NULL) {
42 perror(*argv); 42 perror(*argv);
43 return(FALSE); 43 exit(FALSE);
44 } 44 }
45 while ((c = getc(file)) != EOF) 45 while ((c = getc(file)) != EOF)
46 putc(c, stdout); 46 putc(c, stdout);
@@ -50,5 +50,5 @@ extern int cat_more_main(int argc, char **argv)
50 argc--; 50 argc--;
51 argv++; 51 argv++;
52 } 52 }
53 return(TRUE); 53 exit(TRUE);
54} 54}