diff --git a/coreutils/cat.c b/coreutils/cat.c index 8ecda05..d3e3c97 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -14,13 +14,16 @@ void cat(const int fd) { } int main(const int argc, const char **argv) { - if (argc == 1 || argv[1][0] == '-') + if (argc == 1) cat(STDIN_FILENO); else { for (int i = 1; i < argc; i++) { if (argv[i][0] == '-') - break; + if (argv[i][1]) + break; + else + cat(STDIN_FILENO); int fd = open(argv[i], O_RDONLY); if (fd < 0) {