diff options
author | Eric Andersen | 1999-10-12 15:42:48 +0000 |
---|---|---|
committer | Eric Andersen | 1999-10-12 15:42:48 +0000 |
commit | 2ce1edcf544ac675e6762c9861a6b918401ea716 (patch) | |
tree | 34245558cd448f01969679fc420de4dfd246dc13 /cat.c | |
parent | f811e07b072600a3784a92e5a1dc8a93dac477eb (diff) | |
download | busybox-2ce1edcf544ac675e6762c9861a6b918401ea716.zip busybox-2ce1edcf544ac675e6762c9861a6b918401ea716.tar.gz |
Latest and greatest.
-Erik
Diffstat (limited to 'cat.c')
-rw-r--r-- | cat.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -29,9 +29,9 @@ extern int cat_more_main(int argc, char **argv) int c; FILE *file = stdin; - if (argc < 2) { + if ( (argc < 2) || (**(argv+1) == '-') ) { fprintf(stderr, "Usage: %s %s", *argv, cat_usage); - return(FALSE); + exit(FALSE); } argc--; argv++; @@ -40,7 +40,7 @@ extern int cat_more_main(int argc, char **argv) file = fopen(*argv, "r"); if (file == NULL) { perror(*argv); - return(FALSE); + exit(FALSE); } while ((c = getc(file)) != EOF) putc(c, stdout); @@ -50,5 +50,5 @@ extern int cat_more_main(int argc, char **argv) argc--; argv++; } - return(TRUE); + exit(TRUE); } |