From 3afc38f7e7e9e0461c67064147973b1e1b812c58 Mon Sep 17 00:00:00 2001 From: George Fox Date: Tue, 7 Nov 2023 18:52:38 +0300 Subject: [PATCH] Woops, forgot to add this one. --- coreutils/cat.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) {