aboutsummaryrefslogtreecommitdiff
path: root/cat.c
diff options
context:
space:
mode:
Diffstat (limited to 'cat.c')
-rw-r--r--cat.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/cat.c b/cat.c
index 51f1d27a6..151ce4e61 100644
--- a/cat.c
+++ b/cat.c
@@ -26,20 +26,21 @@
26 26
27extern int cat_main(int argc, char **argv) 27extern int cat_main(int argc, char **argv)
28{ 28{
29 int status = EXIT_SUCCESS;
30
29 if (argc == 1) { 31 if (argc == 1) {
30 print_file(stdin); 32 print_file(stdin);
31 exit(TRUE); 33 return status;
32 } 34 }
33 35
34 while (--argc > 0) { 36 while (--argc > 0) {
35 if(!(strcmp(*++argv, "-"))) { 37 if(!(strcmp(*++argv, "-"))) {
36 print_file(stdin); 38 print_file(stdin);
37 } else if (print_file_by_name(*argv) == FALSE) { 39 } else if (print_file_by_name(*argv) == FALSE) {
38 perror(*argv); 40 status = EXIT_FAILURE;
39 exit(FALSE);
40 } 41 }
41 } 42 }
42 return(TRUE); 43 return status;
43} 44}
44 45
45/* 46/*