Latest and greatest.
-Erik
diff --git a/coreutils/cat.c b/coreutils/cat.c
index 0f2460e..8718c4d 100644
--- a/coreutils/cat.c
+++ b/coreutils/cat.c
@@ -29,9 +29,9 @@
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 @@
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 @@
argc--;
argv++;
}
- return(TRUE);
+ exit(TRUE);
}