aboutsummaryrefslogtreecommitdiff
path: root/coreutils/cat.c
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils/cat.c')
-rw-r--r--coreutils/cat.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 758a83e6b..0d32efe84 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -46,10 +46,9 @@ extern int cat_main(int argc, char **argv)
usage ("cat [file ...]\n");
}
argc--;
- argv++;
- while (argc-- > 0) {
- file = fopen(*(argv++), "r");
+ while (argc-- > 0 && *(argv++) != '\0' && strlen(*argv) ) {
+ file = fopen(*argv, "r");
if (file == NULL) {
perror(*argv);
exit(FALSE);