diff options
Diffstat (limited to 'cat.c')
-rw-r--r-- | cat.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -26,20 +26,21 @@ | |||
26 | 26 | ||
27 | extern int cat_main(int argc, char **argv) | 27 | extern 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 | /* |