aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-09-21 02:39:50 +0000
committerEric Andersen <andersen@codepoet.org>2000-09-21 02:39:50 +0000
commitd1de4a16ad662bdd8e26da5662a5b0678ce4995e (patch)
tree83d6bc1482cd26248cb88f06949f74bc8328b3b6
parentf34aa4c3781d42b400ddc451555aff11110f5ac3 (diff)
downloadbusybox-w32-d1de4a16ad662bdd8e26da5662a5b0678ce4995e.tar.gz
busybox-w32-d1de4a16ad662bdd8e26da5662a5b0678ce4995e.tar.bz2
busybox-w32-d1de4a16ad662bdd8e26da5662a5b0678ce4995e.zip
Handle 'cat -'
-rw-r--r--cat.c7
-rw-r--r--coreutils/cat.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/cat.c b/cat.c
index 6a9204fe7..d47f814cf 100644
--- a/cat.c
+++ b/cat.c
@@ -31,11 +31,10 @@ extern int cat_main(int argc, char **argv)
31 exit(TRUE); 31 exit(TRUE);
32 } 32 }
33 33
34 if (**(argv + 1) == '-')
35 usage(cat_usage);
36
37 while (--argc > 0) { 34 while (--argc > 0) {
38 if (print_file_by_name(*++argv) == FALSE) { 35 if(!(strcmp(*++argv, "-"))) {
36 print_file(stdin);
37 } else if (print_file_by_name(*argv) == FALSE) {
39 perror(*argv); 38 perror(*argv);
40 exit(FALSE); 39 exit(FALSE);
41 } 40 }
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 6a9204fe7..d47f814cf 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -31,11 +31,10 @@ extern int cat_main(int argc, char **argv)
31 exit(TRUE); 31 exit(TRUE);
32 } 32 }
33 33
34 if (**(argv + 1) == '-')
35 usage(cat_usage);
36
37 while (--argc > 0) { 34 while (--argc > 0) {
38 if (print_file_by_name(*++argv) == FALSE) { 35 if(!(strcmp(*++argv, "-"))) {
36 print_file(stdin);
37 } else if (print_file_by_name(*argv) == FALSE) {
39 perror(*argv); 38 perror(*argv);
40 exit(FALSE); 39 exit(FALSE);
41 } 40 }