From 93ec00d3d6c0424ece3b3161d03903ded8dd5239 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 4 Nov 2023 17:55:02 +0300 Subject: [PATCH] fix cat --- coreutils/cat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/coreutils/cat.c b/coreutils/cat.c index 2254a15..8ecda05 100644 --- a/coreutils/cat.c +++ b/coreutils/cat.c @@ -5,7 +5,7 @@ #include void cat(const int fd) { - char buf[4096]; + char buf[8096]; ssize_t len; while ((len = read(fd, buf, sizeof(buf))) > 0) @@ -14,7 +14,7 @@ void cat(const int fd) { } int main(const int argc, const char **argv) { - if (argc == 1) + if (argc == 1 || argv[1][0] == '-') cat(STDIN_FILENO); else {