Making note of my changes
[oweals/busybox.git] / cat.c
diff --git a/cat.c b/cat.c
index 1f4ef4af8ddce911d66d54d038ff81051b86ee54..0d32efe84958913481df5715a64029a954aa3095 100644 (file)
--- a/cat.c
+++ b/cat.c
@@ -46,17 +46,14 @@ extern int cat_main(int argc, char **argv)
        usage ("cat [file ...]\n");
     }
     argc--;
-    argv++;
 
-    while (argc-- > 0) {
+    while (argc-- > 0 && *(argv++) != '\0' && strlen(*argv) ) {
        file = fopen(*argv, "r");
        if (file == NULL) {
            perror(*argv);
            exit(FALSE);
        }
        print_file( file);
-       argc--;
-       argv++;
     }
     exit(TRUE);
 }